diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php index b719ca8..648f4f6 100755 --- a/tests/Controller/ApiControllerTest.php +++ b/tests/Controller/ApiControllerTest.php @@ -39,6 +39,7 @@ use phpOMS\Utils\TestUtils; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Editor\Controller\ApiController::class)] final class ApiControllerTest extends \PHPUnit\Framework\TestCase { protected ApplicationAbstract $app; @@ -92,10 +93,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase TestUtils::setMember($this->module, 'app', $this->app); } - /** - * @covers \Modules\Editor\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testCreateEditorDoc() : void { $response = new HttpResponse(); @@ -128,10 +126,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertGreaterThan(0, $response->getDataArray('')['response']->id); } - /** - * @covers \Modules\Editor\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testCreateFileForDoc() : void { $response = new HttpResponse(); @@ -161,10 +156,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertCount(1, $response->getDataArray('')['response']); } - /** - * @covers \Modules\Editor\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testCreateFileForDocEmptyUpload() : void { $response = new HttpResponse(); @@ -178,10 +170,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertEquals(RequestStatusCode::R_400, $response->header->status); } - /** - * @covers \Modules\Editor\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testCreateFileForDocInvalidData() : void { $response = new HttpResponse(); @@ -194,10 +183,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertEquals(RequestStatusCode::R_400, $response->header->status); } - /** - * @covers \Modules\Editor\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testInvalidEditorDocCreateRequest() : void { $response = new HttpResponse(); @@ -210,10 +196,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertEquals(RequestStatusCode::R_400, $response->header->status); } - /** - * @covers \Modules\Editor\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testUpdateEditorDoc() : void { $response = new HttpResponse(); @@ -230,10 +213,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertEquals(1, $response->getDataArray('')['response']->id); } - /** - * @covers \Modules\Editor\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetEditorDoc() : void { $response = new HttpResponse(); @@ -246,10 +226,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertEquals('Changed Title', $response->getDataArray('')['response']->title); } - /** - * @covers \Modules\Editor\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDeleteEditorDoc() : void { $doc = new EditorDoc(); diff --git a/tests/Models/EditorDocMapperTest.php b/tests/Models/EditorDocMapperTest.php index b085f8d..40b3598 100755 --- a/tests/Models/EditorDocMapperTest.php +++ b/tests/Models/EditorDocMapperTest.php @@ -21,12 +21,10 @@ use Modules\Editor\Models\EditorDocMapper; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Editor\Models\EditorDocMapper::class)] final class EditorDocMapperTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Editor\Models\EditorDocMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testCRUD() : void { $doc = new EditorDoc(); diff --git a/tests/Models/EditorDocTest.php b/tests/Models/EditorDocTest.php index 9d81014..3c4e24c 100755 --- a/tests/Models/EditorDocTest.php +++ b/tests/Models/EditorDocTest.php @@ -20,6 +20,7 @@ use Modules\Editor\Models\EditorDoc; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Editor\Models\EditorDoc::class)] final class EditorDocTest extends \PHPUnit\Framework\TestCase { private EditorDoc $doc; @@ -32,10 +33,7 @@ final class EditorDocTest extends \PHPUnit\Framework\TestCase $this->doc = new EditorDoc(); } - /** - * @covers \Modules\Editor\Models\EditorDoc - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { self::assertEquals(0, $this->doc->id); @@ -48,60 +46,42 @@ final class EditorDocTest extends \PHPUnit\Framework\TestCase self::assertEquals((new \DateTime('now'))->format('Y-m-d'), $this->doc->createdAt->format('Y-m-d')); } - /** - * @covers \Modules\Editor\Models\EditorDoc - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testCreatedByInputOutput() : void { $this->doc->createdBy = new NullAccount(1); self::assertEquals(1, $this->doc->createdBy->id); } - /** - * @covers \Modules\Editor\Models\EditorDoc - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testTitleInputOutput() : void { $this->doc->title = 'Title'; self::assertEquals('Title', $this->doc->title); } - /** - * @covers \Modules\Editor\Models\EditorDoc - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testContentInputOutput() : void { $this->doc->content = 'Content'; self::assertEquals('Content', $this->doc->content); } - /** - * @covers \Modules\Editor\Models\EditorDoc - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testPlainInputOutput() : void { $this->doc->plain = 'Plain'; self::assertEquals('Plain', $this->doc->plain); } - /** - * @covers \Modules\Editor\Models\EditorDoc - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testPathInputOutput() : void { $this->doc->setVirtualPath('/some/test/path'); self::assertEquals('/some/test/path', $this->doc->getVirtualPath()); } - /** - * @covers \Modules\Editor\Models\EditorDoc - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testSerialization() : void { $this->doc->createdBy = new NullAccount(1); diff --git a/tests/Models/NullEditorDocHistoryTest.php b/tests/Models/NullEditorDocHistoryTest.php index 0f34481..599a053 100644 --- a/tests/Models/NullEditorDocHistoryTest.php +++ b/tests/Models/NullEditorDocHistoryTest.php @@ -19,31 +19,23 @@ use Modules\Editor\Models\NullEditorDocHistory; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Editor\Models\NullEditorDocHistory::class)] final class NullEditorDocHistoryTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Editor\Models\NullEditorDocHistory - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Editor\Models\EditorDocHistory', new NullEditorDocHistory()); } - /** - * @covers \Modules\Editor\Models\NullEditorDocHistory - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullEditorDocHistory(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Editor\Models\NullEditorDocHistory - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullEditorDocHistory(2); diff --git a/tests/Models/NullEditorDocTest.php b/tests/Models/NullEditorDocTest.php index 0472c25..43879bc 100755 --- a/tests/Models/NullEditorDocTest.php +++ b/tests/Models/NullEditorDocTest.php @@ -19,31 +19,23 @@ use Modules\Editor\Models\NullEditorDoc; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Editor\Models\NullEditorDoc::class)] final class NullEditorDocTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Editor\Models\NullEditorDoc - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Editor\Models\EditorDoc', new NullEditorDoc()); } - /** - * @covers \Modules\Editor\Models\NullEditorDoc - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullEditorDoc(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Editor\Models\NullEditorDoc - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullEditorDoc(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* + +