diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php index 7fc4912..22d1020 100755 --- a/tests/Controller/ApiControllerTest.php +++ b/tests/Controller/ApiControllerTest.php @@ -38,6 +38,7 @@ /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Profile\Controller\ApiController::class)] final class ApiControllerTest extends \PHPUnit\Framework\TestCase { protected ApplicationAbstract $app; @@ -91,10 +92,7 @@ protected function setUp() : void TestUtils::setMember($this->module, 'app', $this->app); } - /** - * @covers \Modules\Profile\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiProfileCreate() : void { \Modules\Admin\tests\Helper::createAccounts(1); @@ -110,10 +108,7 @@ public function testApiProfileCreate() : void self::assertGreaterThan(0, $response->getDataArray('')['response'][0]->id); } - /** - * @covers \Modules\Profile\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiProfileTempLoginCreate() : void { $response = new HttpResponse(); @@ -125,10 +120,7 @@ public function testApiProfileTempLoginCreate() : void self::assertGreaterThan(31, \strlen($response->getDataArray('')['response'])); } - /** - * @covers \Modules\Profile\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiProfileImageSet() : void { \copy(__DIR__ . '/icon.png', __DIR__ . '/temp_icon.png'); @@ -154,10 +146,7 @@ public function testApiProfileImageSet() : void self::assertEquals('Profile Logo', $image->name); } - /** - * @covers \Modules\Profile\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiProfileImageSetInvalid() : void { $response = new HttpResponse(); @@ -167,31 +156,23 @@ public function testApiProfileImageSetInvalid() : void self::assertEquals(RequestStatusCode::R_400, $response->header->status); } - /** - * @covers \Modules\Profile\Controller\ApiController - * @group module - */ /* public function testApiContactElementCreate() : void { $response = new HttpResponse(); $request = new HttpRequest(); - + $request->header->account = 1; $request->setData('account', '1'); $request->setData('type', ContactType::PHONE); $request->setData('content', '+0123-456-789'); $request->setData('contact', '1'); - + $this->module->apiContactElementCreate($request, $response); self::assertGreaterThan(0, $response->getDataArray('')['response']->id); } */ - - /** - * @covers \Modules\Profile\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiContactElementCreateInvalidData() : void { $response = new HttpResponse(); diff --git a/tests/Models/ContactElementTest.php b/tests/Models/ContactElementTest.php index 0f0b6c8..5a0ae6f 100755 --- a/tests/Models/ContactElementTest.php +++ b/tests/Models/ContactElementTest.php @@ -19,6 +19,7 @@ /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Profile\Models\ContactElement::class)] final class ContactElementTest extends \PHPUnit\Framework\TestCase { private ContactElement $contact; @@ -31,10 +32,7 @@ protected function setUp() : void $this->contact = new ContactElement(); } - /** - * @covers \Modules\Profile\Models\ContactElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { self::assertEquals(0, $this->contact->id); diff --git a/tests/Models/ContactTest.php b/tests/Models/ContactTest.php index 172a89a..8133e93 100755 --- a/tests/Models/ContactTest.php +++ b/tests/Models/ContactTest.php @@ -19,6 +19,7 @@ /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Profile\Models\Contact::class)] final class ContactTest extends \PHPUnit\Framework\TestCase { private Contact $contact; @@ -31,10 +32,7 @@ protected function setUp() : void $this->contact = new Contact(); } - /** - * @covers \Modules\Profile\Models\Contact - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { self::assertEquals(0, $this->contact->id); diff --git a/tests/Models/NullContactElementTest.php b/tests/Models/NullContactElementTest.php index d6386f8..9cb14c1 100755 --- a/tests/Models/NullContactElementTest.php +++ b/tests/Models/NullContactElementTest.php @@ -19,31 +19,23 @@ /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Profile\Models\NullContactElement::class)] final class NullContactElementTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Profile\Models\NullContactElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Profile\Models\ContactElement', new NullContactElement()); } - /** - * @covers \Modules\Profile\Models\NullContactElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullContactElement(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Profile\Models\NullContactElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullContactElement(2); diff --git a/tests/Models/NullContactTest.php b/tests/Models/NullContactTest.php index 2d86782..721f353 100755 --- a/tests/Models/NullContactTest.php +++ b/tests/Models/NullContactTest.php @@ -19,31 +19,23 @@ /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Profile\Models\NullContact::class)] final class NullContactTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Profile\Models\NullContact - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Profile\Models\Contact', new NullContact()); } - /** - * @covers \Modules\Profile\Models\NullContact - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullContact(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Profile\Models\NullContact - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullContact(2); diff --git a/tests/Models/NullProfileTest.php b/tests/Models/NullProfileTest.php index 04a8983..26d25c7 100755 --- a/tests/Models/NullProfileTest.php +++ b/tests/Models/NullProfileTest.php @@ -19,31 +19,23 @@ /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Profile\Models\NullProfile::class)] final class NullProfileTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Profile\Models\NullProfile - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Profile\Models\Profile', new NullProfile()); } - /** - * @covers \Modules\Profile\Models\NullProfile - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullProfile(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Profile\Models\NullProfile - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullProfile(2); diff --git a/tests/Models/ProfileMapperTest.php b/tests/Models/ProfileMapperTest.php index 2b82317..ba23d26 100755 --- a/tests/Models/ProfileMapperTest.php +++ b/tests/Models/ProfileMapperTest.php @@ -23,12 +23,10 @@ /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Profile\Models\ProfileMapper::class)] final class ProfileMapperTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Profile\Models\ProfileMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testCRUD() : void { $media = new Media(); diff --git a/tests/Models/ProfileTest.php b/tests/Models/ProfileTest.php index 0f736d9..7a7d38d 100755 --- a/tests/Models/ProfileTest.php +++ b/tests/Models/ProfileTest.php @@ -23,6 +23,7 @@ /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Profile\Models\Profile::class)] final class ProfileTest extends \PHPUnit\Framework\TestCase { private Profile $profile; @@ -35,10 +36,7 @@ protected function setUp() : void $this->profile = new Profile(); } - /** - * @covers \Modules\Profile\Models\Profile - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { self::assertEquals(0, $this->profile->id); @@ -49,20 +47,14 @@ public function testDefault() : void self::assertNull($this->profile->birthday); } - /** - * @covers \Modules\Profile\Models\Profile - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGenderInputOutput() : void { $this->profile->setGender(GenderType::FEMALE); self::assertEquals(GenderType::FEMALE, $this->profile->getGender()); } - /** - * @covers \Modules\Profile\Models\Profile - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testInvalidGender() : void { $this->expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); @@ -70,20 +62,14 @@ public function testInvalidGender() : void $this->profile->setGender(9999); } - /** - * @covers \Modules\Profile\Models\Profile - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testSexInputOutput() : void { $this->profile->setSex(SexType::FEMALE); self::assertEquals(SexType::FEMALE, $this->profile->getSex()); } - /** - * @covers \Modules\Profile\Models\Profile - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testInvalidSex() : void { $this->expectException(\phpOMS\Stdlib\Base\Exception\InvalidEnumValue::class); @@ -91,30 +77,21 @@ public function testInvalidSex() : void $this->profile->setSex(9999); } - /** - * @covers \Modules\Profile\Models\Profile - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testBirthdayInputOutput() : void { $this->profile->birthday = ($date = new \DateTime('now')); self::assertEquals($date, $this->profile->birthday); } - /** - * @covers \Modules\Profile\Models\Profile - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testImageInputOutput() : void { $this->profile->image = new NullMedia(1); self::assertEquals(1, $this->profile->image->id); } - /** - * @covers \Modules\Profile\Models\Profile - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testAccountInputOutput() : void { $this->profile->account = new NullAccount(1); @@ -124,10 +101,7 @@ public function testAccountInputOutput() : void self::assertEquals(1, $profile->account->id); } - /** - * @covers \Modules\Profile\Models\Profile - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testSerialize() : void { $this->profile->setGender(GenderType::FEMALE); 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* + +