diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php index eb14a84..7f6ad19 100755 --- a/tests/Controller/ApiControllerTest.php +++ b/tests/Controller/ApiControllerTest.php @@ -34,10 +34,10 @@ use phpOMS\System\MimeType; use phpOMS\Utils\TestUtils; /** - * @testdox Modules\Comments\tests\Controller\ApiControllerTest: Comments api controller - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Comments\Controller\ApiController::class)] +#[\PHPUnit\Framework\Attributes\TestDox('Modules\Comments\tests\Controller\ApiControllerTest: Comments api controller')] final class ApiControllerTest extends \PHPUnit\Framework\TestCase { protected ApplicationAbstract $app; @@ -92,10 +92,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase TestUtils::setMember($this->module, 'app', $this->app); } - /** - * @covers \Modules\Comments\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiCommentListCU() : void { $response = new HttpResponse(); @@ -123,10 +120,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertEquals(2, $response->getDataArray('')['response']->status); } - /** - * @covers \Modules\Comments\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiCommentCRU() : void { // create @@ -189,10 +183,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertEquals('New plain', $response->getDataArray('')['response']->contentRaw); } - /** - * @covers \Modules\Comments\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiCommentCreateInvalidData() : void { $response = new HttpResponse(); @@ -205,10 +196,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertEquals(RequestStatusCode::R_400, $response->header->status); } - /** - * @covers \Modules\Comments\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiCommentVoteCreateInvalidData() : void { $response = new HttpResponse(); @@ -221,10 +209,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertEquals(RequestStatusCode::R_400, $response->header->status); } - /** - * @covers \Modules\Comments\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiCommentVoteCreate() : void { $response = new HttpResponse(); diff --git a/tests/Models/CommentListMapperTest.php b/tests/Models/CommentListMapperTest.php index e40a91d..48576f1 100755 --- a/tests/Models/CommentListMapperTest.php +++ b/tests/Models/CommentListMapperTest.php @@ -22,12 +22,10 @@ use Modules\Comments\Models\CommentListMapper; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Comments\Models\CommentListMapper::class)] final class CommentListMapperTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Comments\Models\CommentListMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testCRUD() : void { $list = new CommentList(); diff --git a/tests/Models/CommentListTest.php b/tests/Models/CommentListTest.php index f95ec0d..d77fed8 100755 --- a/tests/Models/CommentListTest.php +++ b/tests/Models/CommentListTest.php @@ -20,6 +20,7 @@ use Modules\Comments\Models\CommentList; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Comments\Models\CommentList::class)] final class CommentListTest extends \PHPUnit\Framework\TestCase { private CommentList $list; @@ -32,20 +33,14 @@ final class CommentListTest extends \PHPUnit\Framework\TestCase $this->list = new CommentList(); } - /** - * @covers \Modules\Comments\Models\CommentList - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { self::assertEquals(0, $this->list->id); self::assertEquals([], $this->list->getComments()); } - /** - * @covers \Modules\Comments\Models\CommentList - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetSet() : void { $comment = new Comment(); diff --git a/tests/Models/CommentMapperTest.php b/tests/Models/CommentMapperTest.php index 43fafc3..1047813 100755 --- a/tests/Models/CommentMapperTest.php +++ b/tests/Models/CommentMapperTest.php @@ -22,12 +22,10 @@ use Modules\Comments\Models\CommentMapper; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Comments\Models\CommentMapper::class)] final class CommentMapperTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Comments\Models\CommentMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testCRUD() : void { $comment = new Comment(); diff --git a/tests/Models/CommentTest.php b/tests/Models/CommentTest.php index ae54ad4..5fd94da 100755 --- a/tests/Models/CommentTest.php +++ b/tests/Models/CommentTest.php @@ -22,6 +22,7 @@ use Modules\Comments\Models\NullComment; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Comments\Models\Comment::class)] final class CommentTest extends \PHPUnit\Framework\TestCase { private Comment $comment; @@ -34,10 +35,7 @@ final class CommentTest extends \PHPUnit\Framework\TestCase $this->comment = new Comment(); } - /** - * @covers \Modules\Comments\Models\Comment - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { self::assertEquals(0, $this->comment->id); @@ -52,30 +50,21 @@ final class CommentTest extends \PHPUnit\Framework\TestCase self::assertEquals([], $this->comment->files); } - /** - * @covers \Modules\Comments\Models\Comment - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testCreatedByInputOutput() : void { $this->comment->createdBy = new NullAccount(1); self::assertEquals(1, $this->comment->createdBy->id); } - /** - * @covers \Modules\Comments\Models\Comment - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testListInputOutput() : void { $this->comment->list = 3; self::assertEquals(3, $this->comment->list); } - /** - * @covers \Modules\Comments\Models\Comment - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testRefInputOutput() : void { $this->comment->ref = 2; @@ -85,30 +74,21 @@ final class CommentTest extends \PHPUnit\Framework\TestCase self::assertEquals(3, $this->comment->ref->id); } - /** - * @covers \Modules\Comments\Models\Comment - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testTitleInputOutput() : void { $this->comment->title = 'Test Title'; self::assertEquals('Test Title', $this->comment->title); } - /** - * @covers \Modules\Comments\Models\Comment - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testContentInputOutput() : void { $this->comment->content = 'Test Content'; self::assertEquals('Test Content', $this->comment->content); } - /** - * @covers \Modules\Comments\Models\Comment - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testSerialize() : void { $this->comment->title = 'Title'; diff --git a/tests/Models/CommentVoteMapperTest.php b/tests/Models/CommentVoteMapperTest.php index 7b1a118..923f644 100755 --- a/tests/Models/CommentVoteMapperTest.php +++ b/tests/Models/CommentVoteMapperTest.php @@ -25,12 +25,10 @@ use Modules\Comments\Models\CommentVoteMapper; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Comments\Models\CommentVoteMapper::class)] final class CommentVoteMapperTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Comments\Models\CommentVoteMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testCR() : void { $list = new CommentList(); diff --git a/tests/Models/CommentVoteTest.php b/tests/Models/CommentVoteTest.php index a976a15..18e1f16 100755 --- a/tests/Models/CommentVoteTest.php +++ b/tests/Models/CommentVoteTest.php @@ -19,6 +19,7 @@ use Modules\Comments\Models\CommentVote; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Comments\Models\CommentVote::class)] final class CommentVoteTest extends \PHPUnit\Framework\TestCase { private CommentVote $vote; @@ -31,10 +32,7 @@ final class CommentVoteTest extends \PHPUnit\Framework\TestCase $this->vote = new CommentVote(); } - /** - * @covers \Modules\Comments\Models\CommentVote - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { self::assertEquals(0, $this->vote->id); @@ -44,20 +42,14 @@ final class CommentVoteTest extends \PHPUnit\Framework\TestCase self::assertInstanceOf('\DateTimeImmutable', $this->vote->createdAt); } - /** - * @covers \Modules\Comments\Models\CommentVote - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testScoreInputOutput() : void { $this->vote->score = 1; self::assertEquals(1, $this->vote->score); } - /** - * @covers \Modules\Comments\Models\CommentVote - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testCommentInputOutput() : void { $this->vote->comment = 1; diff --git a/tests/Models/NullCommentListTest.php b/tests/Models/NullCommentListTest.php index 3225493..da9ed61 100755 --- a/tests/Models/NullCommentListTest.php +++ b/tests/Models/NullCommentListTest.php @@ -19,31 +19,23 @@ use Modules\Comments\Models\NullCommentList; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Comments\Models\NullCommentList::class)] final class NullCommentListTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Comments\Models\NullCommentList - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Comments\Models\CommentList', new NullCommentList()); } - /** - * @covers \Modules\Comments\Models\NullCommentList - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullCommentList(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Comments\Models\NullCommentList - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullCommentList(2); diff --git a/tests/Models/NullCommentTest.php b/tests/Models/NullCommentTest.php index f5d6c7a..10036d7 100755 --- a/tests/Models/NullCommentTest.php +++ b/tests/Models/NullCommentTest.php @@ -19,31 +19,23 @@ use Modules\Comments\Models\NullComment; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Comments\Models\NullComment::class)] final class NullCommentTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Comments\Models\NullComment - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Comments\Models\Comment', new NullComment()); } - /** - * @covers \Modules\Comments\Models\NullComment - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullComment(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Comments\Models\NullComment - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullComment(2); diff --git a/tests/Models/NullCommentVoteTest.php b/tests/Models/NullCommentVoteTest.php index 6322411..382e7f4 100755 --- a/tests/Models/NullCommentVoteTest.php +++ b/tests/Models/NullCommentVoteTest.php @@ -19,31 +19,23 @@ use Modules\Comments\Models\NullCommentVote; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Comments\Models\NullCommentVote::class)] final class NullCommentVoteTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Comments\Models\NullCommentVote - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Comments\Models\CommentVote', new NullCommentVote()); } - /** - * @covers \Modules\Comments\Models\NullCommentVote - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullCommentVote(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Comments\Models\NullCommentVote - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullCommentVote(2); diff --git a/tests/phpunit_default.xml b/tests/phpunit_default.xml index d350430..e4a5639 100755 --- a/tests/phpunit_default.xml +++ b/tests/phpunit_default.xml @@ -1,31 +1,6 @@ - - - - ../ - - - ../vendor* - ../MainRepository* - ../Karaka* - ../Admin/Install/Application* - ../phpOMS* - ../tests* - ../*/tests* - ../**/tests* - */tests* - ../* - ../* - ../* - ../* - ../* - ../**/test* - ../**/Theme* - ../**/Admin/Routes* - ../**/Admin/Hooks* - ../**/Admin/Install* - ../Media/Files* - + + @@ -56,4 +31,31 @@ + + + ../ + + + ../vendor* + ../MainRepository* + ../Karaka* + ../Admin/Install/Application* + ../phpOMS* + ../tests* + ../*/tests* + ../**/tests* + */tests* + ../* + ../* + ../* + ../* + ../* + ../**/test* + ../**/Theme* + ../**/Admin/Routes* + ../**/Admin/Hooks* + ../**/Admin/Install* + ../Media/Files* + +