From b159dd4b8b9c08d30ec39f358e45845ab07b7f1b Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Mon, 16 Oct 2023 23:39:38 +0000 Subject: [PATCH] Add test cases for null models --- tests/Models/NullCommentListTest.php | 14 ++++++++++++-- tests/Models/NullCommentTest.php | 14 ++++++++++++-- tests/Models/NullCommentVoteTest.php | 14 ++++++++++++-- 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/tests/Models/NullCommentListTest.php b/tests/Models/NullCommentListTest.php index 975285c..6181dd2 100755 --- a/tests/Models/NullCommentListTest.php +++ b/tests/Models/NullCommentListTest.php @@ -23,7 +23,7 @@ final class NullCommentListTest extends \PHPUnit\Framework\TestCase { /** * @covers Modules\Comments\Models\NullCommentList - * @group framework + * @group module */ public function testNull() : void { @@ -32,11 +32,21 @@ final class NullCommentListTest extends \PHPUnit\Framework\TestCase /** * @covers Modules\Comments\Models\NullCommentList - * @group framework + * @group module */ public function testId() : void { $null = new NullCommentList(2); self::assertEquals(2, $null->id); } + + /** + * @covers Modules\Comments\Models\NullCommentList + * @group module + */ + public function testJsonSerialize() : void + { + $null = new NullCommentList(2); + self::assertEquals(['id' => 2], $null); + } } diff --git a/tests/Models/NullCommentTest.php b/tests/Models/NullCommentTest.php index 49bf9a2..eb038d4 100755 --- a/tests/Models/NullCommentTest.php +++ b/tests/Models/NullCommentTest.php @@ -23,7 +23,7 @@ final class NullCommentTest extends \PHPUnit\Framework\TestCase { /** * @covers Modules\Comments\Models\NullComment - * @group framework + * @group module */ public function testNull() : void { @@ -32,11 +32,21 @@ final class NullCommentTest extends \PHPUnit\Framework\TestCase /** * @covers Modules\Comments\Models\NullComment - * @group framework + * @group module */ public function testId() : void { $null = new NullComment(2); self::assertEquals(2, $null->id); } + + /** + * @covers Modules\Comments\Models\NullComment + * @group module + */ + public function testJsonSerialize() : void + { + $null = new NullComment(2); + self::assertEquals(['id' => 2], $null); + } } diff --git a/tests/Models/NullCommentVoteTest.php b/tests/Models/NullCommentVoteTest.php index ebe0e93..83b34f5 100755 --- a/tests/Models/NullCommentVoteTest.php +++ b/tests/Models/NullCommentVoteTest.php @@ -23,7 +23,7 @@ final class NullCommentVoteTest extends \PHPUnit\Framework\TestCase { /** * @covers Modules\Comments\Models\NullCommentVote - * @group framework + * @group module */ public function testNull() : void { @@ -32,11 +32,21 @@ final class NullCommentVoteTest extends \PHPUnit\Framework\TestCase /** * @covers Modules\Comments\Models\NullCommentVote - * @group framework + * @group module */ public function testId() : void { $null = new NullCommentVote(2); self::assertEquals(2, $null->id); } + + /** + * @covers Modules\Comments\Models\NullCommentVote + * @group module + */ + public function testJsonSerialize() : void + { + $null = new NullCommentVote(2); + self::assertEquals(['id' => 2], $null); + } }