-<?php namespace Tests\Entity;
+<?php
+
+namespace Tests\Entity;
-use BookStack\Entities\Models\Page;
use BookStack\Actions\Comment;
+use BookStack\Entities\Models\Page;
use Tests\TestCase;
class CommentTest extends TestCase
{
-
public function test_add_comment()
{
$this->asAdmin();
$pageResp->assertSee($comment->text);
$this->assertDatabaseHas('comments', [
- 'local_id' => 1,
- 'entity_id' => $page->id,
+ 'local_id' => 1,
+ 'entity_id' => $page->id,
'entity_type' => Page::newModelInstance()->getMorphClass(),
- 'text' => $comment->text,
- 'parent_id' => 2
+ 'text' => $comment->text,
+ 'parent_id' => 2,
]);
}
$resp->assertDontSee($comment->text);
$this->assertDatabaseHas('comments', [
- 'text' => $newText,
- 'entity_id' => $page->id
+ 'text' => $newText,
+ 'entity_id' => $page->id,
]);
}
$resp->assertStatus(200);
$this->assertDatabaseMissing('comments', [
- 'id' => $comment->id
+ 'id' => $comment->id,
]);
}
]);
$this->assertDatabaseHas('comments', [
- 'entity_id' => $page->id,
+ 'entity_id' => $page->id,
'entity_type' => $page->getMorphClass(),
- 'text' => '# My Title',
- 'html' => "<h1>My Title</h1>\n",
+ 'text' => '# My Title',
+ 'html' => "<h1>My Title</h1>\n",
]);
$pageView = $this->get($page->getUrl());