diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 55a7ab5..bd6c899 100644 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -131,11 +131,11 @@ final class ApiController extends Controller */ private function createCommentFromRequest(RequestAbstract $request) : Comment { - $comment = new Comment(); - $comment->createdBy = new NullAccount($request->header->account); - $comment->title = (string) ($request->getData('title') ?? ''); + $comment = new Comment(); + $comment->createdBy = new NullAccount($request->header->account); + $comment->title = (string) ($request->getData('title') ?? ''); $comment->contentRaw = (string) ($request->getData('plain') ?? ''); - $comment->content = Markdown::parse((string) ($request->getData('plain') ?? '')); + $comment->content = Markdown::parse((string) ($request->getData('plain') ?? '')); $comment->setRef($request->getData('ref') !== null ? (int) $request->getData('ref') : null); $comment->setList((int) ($request->getData('list') ?? 0)); diff --git a/Theme/Backend/Components/Comment/list.tpl.php b/Theme/Backend/Components/Comment/list.tpl.php index 156c5ae..d047829 100644 --- a/Theme/Backend/Components/Comment/list.tpl.php +++ b/Theme/Backend/Components/Comment/list.tpl.php @@ -6,7 +6,7 @@ foreach ($comments as $comment) : ?>
- getContent(); ?> + content; ?>
diff --git a/tests/Models/CommentListMapperTest.php b/tests/Models/CommentListMapperTest.php index c38df77..83850e7 100755 --- a/tests/Models/CommentListMapperTest.php +++ b/tests/Models/CommentListMapperTest.php @@ -32,9 +32,9 @@ class CommentListMapperTest extends \PHPUnit\Framework\TestCase { $list = new CommentList(); - $comment = new Comment(); + $comment = new Comment(); $comment->createdBy = new NullAccount(1); - $comment->title = 'Test Comment'; + $comment->title = 'Test Comment'; $list->addComment($comment); diff --git a/tests/Models/CommentListTest.php b/tests/Models/CommentListTest.php index 8bee623..b53bb35 100755 --- a/tests/Models/CommentListTest.php +++ b/tests/Models/CommentListTest.php @@ -39,11 +39,11 @@ class CommentListTest extends \PHPUnit\Framework\TestCase */ public function testGetSet() : void { - $list = new CommentList(); - $comment = new Comment(); - $comment->title = 'Test Title'; + $list = new CommentList(); + $comment = new Comment(); + $comment->title = 'Test Title'; $comment->contentRaw = 'TestRaw'; - $comment->content = 'Test Content'; + $comment->content = 'Test Content'; $list->addComment($comment); self::assertEquals('Test Title', $list->getComments()[0]->title); diff --git a/tests/Models/CommentMapperTest.php b/tests/Models/CommentMapperTest.php index a0fa207..8ab9721 100755 --- a/tests/Models/CommentMapperTest.php +++ b/tests/Models/CommentMapperTest.php @@ -30,10 +30,10 @@ class CommentMapperTest extends \PHPUnit\Framework\TestCase */ public function testCRUD() : void { - $comment = new Comment(); + $comment = new Comment(); $comment->createdBy = new NullAccount(1); - $comment->title = 'Test Title'; - $comment->content = 'Test Content'; + $comment->title = 'Test Title'; + $comment->content = 'Test Content'; $comment->setRef(null); $comment->setList(new CommentList());