From 69d859494552257efbda64ca85d3fa1a253447e2 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 20 Mar 2024 05:15:59 +0000 Subject: [PATCH] upgrade phpunit --- .../Api/ApiControllerAccountTrait.php | 38 +++++------ .../Api/ApiControllerApplicationTrait.php | 2 +- .../Api/ApiControllerGroupTrait.php | 34 +++++----- .../Api/ApiControllerModuleTrait.php | 20 +++--- .../Api/ApiControllerPermissionTrait.php | 50 +++++++-------- .../Api/ApiControllerSettingsTrait.php | 14 ++-- tests/Controller/ApiControllerTest.php | 3 +- tests/Models/AccountMapperTest.php | 64 +++++-------------- tests/Models/AccountPermissionTest.php | 11 ++-- tests/Models/AccountTest.php | 18 ++---- tests/Models/AddressMapperTest.php | 9 +-- tests/Models/AppMapperTest.php | 11 ++-- tests/Models/AppTest.php | 9 +-- tests/Models/DataChangeTest.php | 9 +-- tests/Models/GroupMapperTest.php | 16 ++--- tests/Models/GroupPermissionTest.php | 11 ++-- tests/Models/GroupTest.php | 13 ++-- tests/Models/LocalizationMapperTest.php | 11 ++-- tests/Models/ModuleTest.php | 32 +++------- tests/Models/NullAccountExternalTest.php | 16 ++--- tests/Models/NullAccountPermissionTest.php | 16 ++--- tests/Models/NullAccountTest.php | 16 ++--- tests/Models/NullAppTest.php | 17 ++--- tests/Models/NullDataChangeTest.php | 16 ++--- tests/Models/NullGroupPermissionTest.php | 17 ++--- tests/Models/NullGroupTest.php | 17 ++--- tests/Models/NullModuleTest.php | 16 ++--- tests/phpunit_default.xml | 64 ++++++++++--------- 28 files changed, 217 insertions(+), 353 deletions(-) diff --git a/tests/Controller/Api/ApiControllerAccountTrait.php b/tests/Controller/Api/ApiControllerAccountTrait.php index 850ca88..3d2ca60 100755 --- a/tests/Controller/Api/ApiControllerAccountTrait.php +++ b/tests/Controller/Api/ApiControllerAccountTrait.php @@ -23,10 +23,10 @@ use phpOMS\Message\Http\RequestStatusCode; trait ApiControllerAccountTrait { /** - * @testdox A user can be returned * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A user can be returned')] public function testApiAccountGet() : void { $response = new HttpResponse(); @@ -42,10 +42,10 @@ trait ApiControllerAccountTrait } /** - * @testdox A user can be updated * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A user can be updated')] public function testApiAccountUpdate() : void { $response = new HttpResponse(); @@ -64,10 +64,10 @@ trait ApiControllerAccountTrait } /** - * @testdox A user can be found by name * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A user can be found by name')] public function testApiAccountFind() : void { $response = new HttpResponse(); @@ -82,10 +82,10 @@ trait ApiControllerAccountTrait } /** - * @testdox A user and profile for the user can be created * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A user and profile for the user can be created')] public function testApiAccountAndProfileCreate() : void { $response = new HttpResponse(); @@ -107,8 +107,8 @@ trait ApiControllerAccountTrait /** * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiAccountCreateWithCustomLocale() : void { $response = new HttpResponse(); @@ -130,10 +130,10 @@ trait ApiControllerAccountTrait } /** - * @testdox A user can be deleted * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A user can be deleted')] public function testApiAccountDelete() : void { $response = new HttpResponse(); @@ -154,10 +154,10 @@ trait ApiControllerAccountTrait } /** - * @testdox A invalid user cannot be created * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid user cannot be created')] public function testApiAccountCreateInvalid() : void { $response = new HttpResponse(); @@ -172,10 +172,10 @@ trait ApiControllerAccountTrait } /** - * @testdox A user group can be added to a user * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A user group can be added to a user')] public function testApiAddRemoveGroupToAccount() : void { $response = new HttpResponse(); @@ -197,8 +197,8 @@ trait ApiControllerAccountTrait /** * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiRemoveAdminGroupFromOneselfAccount() : void { $response = new HttpResponse(); @@ -214,8 +214,8 @@ trait ApiControllerAccountTrait /** * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiAccountLogin() : void { $response = new HttpResponse(); @@ -231,8 +231,8 @@ trait ApiControllerAccountTrait /** * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiAccountLoginInvalid() : void { $response = new HttpResponse(); @@ -248,8 +248,8 @@ trait ApiControllerAccountTrait /** * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiAccountLogout() : void { $response = new HttpResponse(); diff --git a/tests/Controller/Api/ApiControllerApplicationTrait.php b/tests/Controller/Api/ApiControllerApplicationTrait.php index b83e6b8..4cb8e43 100755 --- a/tests/Controller/Api/ApiControllerApplicationTrait.php +++ b/tests/Controller/Api/ApiControllerApplicationTrait.php @@ -22,8 +22,8 @@ trait ApiControllerApplicationTrait { /** * @covers \Modules\Admin\Controller\Apicontroller - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiInvalidAppplicationPathInstall() : void { $response = new HttpResponse(); diff --git a/tests/Controller/Api/ApiControllerGroupTrait.php b/tests/Controller/Api/ApiControllerGroupTrait.php index e4a4756..c31b5e3 100755 --- a/tests/Controller/Api/ApiControllerGroupTrait.php +++ b/tests/Controller/Api/ApiControllerGroupTrait.php @@ -22,10 +22,10 @@ use phpOMS\Message\Http\RequestStatusCode; trait ApiControllerGroupTrait { /** - * @testdox A user group can be returned * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A user group can be returned')] public function testApiGroupGet() : void { $response = new HttpResponse(); @@ -41,10 +41,10 @@ trait ApiControllerGroupTrait } /** - * @testdox A user group can be updated * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A user group can be updated')] public function testApiGroupSet() : void { $response = new HttpResponse(); @@ -64,10 +64,10 @@ trait ApiControllerGroupTrait } /** - * @testdox A user group can be found by name * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A user group can be found by name')] public function testApiGroupFind() : void { $response = new HttpResponse(); @@ -82,10 +82,10 @@ trait ApiControllerGroupTrait } /** - * @testdox A user group can be created and deleted * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A user group can be created and deleted')] public function testApiGroupCreateDelete() : void { $response = new HttpResponse(); @@ -109,10 +109,10 @@ trait ApiControllerGroupTrait } /** - * @testdox A user group can be created and deleted * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A user group can be created and deleted')] public function testApiGroupDeleteAdminInvalid() : void { $response = new HttpResponse(); @@ -126,10 +126,10 @@ trait ApiControllerGroupTrait } /** - * @testdox A invalid user group cannot be created * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid user group cannot be created')] public function testApiGroupCreateInvalid() : void { $response = new HttpResponse(); @@ -144,10 +144,10 @@ trait ApiControllerGroupTrait } /** - * @testdox A user can be added to a user group * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A user can be added to a user group')] public function testApiAddRemoveAccountToGroup() : void { $response = new HttpResponse(); @@ -169,8 +169,8 @@ trait ApiControllerGroupTrait /** * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiRemoveAdminAccountFromAdminGroup() : void { $response = new HttpResponse(); @@ -185,10 +185,10 @@ trait ApiControllerGroupTrait } /** - * @testdox A user and user group can be found by name * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A user and user group can be found by name')] public function testApiAccountGroupFind() : void { $response = new HttpResponse(); diff --git a/tests/Controller/Api/ApiControllerModuleTrait.php b/tests/Controller/Api/ApiControllerModuleTrait.php index cc2d46b..250ab4a 100755 --- a/tests/Controller/Api/ApiControllerModuleTrait.php +++ b/tests/Controller/Api/ApiControllerModuleTrait.php @@ -22,10 +22,10 @@ use phpOMS\Message\Http\RequestStatusCode; trait ApiControllerModuleTrait { /** - * @testdox The status of a module can be updated * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('The status of a module can be updated')] public function testApiModuleStatusUpdate() : void { $response = new HttpResponse(); @@ -54,10 +54,10 @@ trait ApiControllerModuleTrait } /** - * @testdox A missing module cannot be updated * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A missing module cannot be updated')] public function testApiModuleStatusUpdateEmptyModule() : void { $response = new HttpResponse(); @@ -73,10 +73,10 @@ trait ApiControllerModuleTrait } /** - * @testdox A invalid module status cannot update a module * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid module status cannot update a module')] public function testApiModuleStatusUpdateInvalidStatus() : void { $response = new HttpResponse(); @@ -91,10 +91,10 @@ trait ApiControllerModuleTrait } /** - * @testdox A invalid module cannot be updated * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid module cannot be updated')] public function testApiModuleStatusUpdateInvalidModule() : void { $response = new HttpResponse(); @@ -109,10 +109,10 @@ trait ApiControllerModuleTrait } /** - * @testdox A module can be re-initialized * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A module can be re-initialized')] public function testApiReInit() : void { $response = new HttpResponse(); diff --git a/tests/Controller/Api/ApiControllerPermissionTrait.php b/tests/Controller/Api/ApiControllerPermissionTrait.php index e9e8f67..0a094b4 100755 --- a/tests/Controller/Api/ApiControllerPermissionTrait.php +++ b/tests/Controller/Api/ApiControllerPermissionTrait.php @@ -23,10 +23,10 @@ use phpOMS\Message\Http\RequestStatusCode; trait ApiControllerPermissionTrait { /** - * @testdox A permission can be added to a user group * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A permission can be added to a user group')] public function testApiAddGroupPermission() : void { $response = new HttpResponse(); @@ -43,8 +43,8 @@ trait ApiControllerPermissionTrait /** * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiAddGroupPermissionToAdmin() : void { $response = new HttpResponse(); @@ -59,10 +59,10 @@ trait ApiControllerPermissionTrait } /** - * @testdox A group permission can be returned * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A group permission can be returned')] public function testApiGroupPermissionGet() : void { $response = new HttpResponse(); @@ -78,10 +78,10 @@ trait ApiControllerPermissionTrait } /** - * @testdox A user group permission can be created and deleted * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A user group permission can be created and deleted')] public function testApiGroupPermissionCreateDelete() : void { $response = new HttpResponse(); @@ -103,10 +103,10 @@ trait ApiControllerPermissionTrait } /** - * @testdox A permission with missing data cannot be added to a user group * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A permission with missing data cannot be added to a user group')] public function testApiAddGroupPermissionInvalidData() : void { $response = new HttpResponse(); @@ -120,10 +120,10 @@ trait ApiControllerPermissionTrait } /** - * @testdox A invalid permission type cannot be added to a user group * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid permission type cannot be added to a user group')] public function testApiAddGroupPermissionInvalidType() : void { $response = new HttpResponse(); @@ -138,10 +138,10 @@ trait ApiControllerPermissionTrait } /** - * @testdox A user group permission can be updated * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A user group permission can be updated')] public function testApiGroupPermissionUpdate() : void { $response = new HttpResponse(); @@ -165,10 +165,10 @@ trait ApiControllerPermissionTrait } /** - * @testdox A permission can be added to a user * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A permission can be added to a user')] public function testApiAddAccountPermission() : void { $response = new HttpResponse(); @@ -184,10 +184,10 @@ trait ApiControllerPermissionTrait } /** - * @testdox A user permission can be returned * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A user permission can be returned')] public function testApiAccountPermissionGet() : void { $response = new HttpResponse(); @@ -203,10 +203,10 @@ trait ApiControllerPermissionTrait } /** - * @testdox A user permission can be created and deleted * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A user permission can be created and deleted')] public function testApiAccountPermissionCreateDelete() : void { $response = new HttpResponse(); @@ -228,10 +228,10 @@ trait ApiControllerPermissionTrait } /** - * @testdox A permission with missing data cannot be added to a user * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A permission with missing data cannot be added to a user')] public function testApiAddAccountPermissionInvalidData() : void { $response = new HttpResponse(); @@ -245,10 +245,10 @@ trait ApiControllerPermissionTrait } /** - * @testdox A invalid permission type cannot be added to a user * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid permission type cannot be added to a user')] public function testApiAddAccountPermissionInvalidType() : void { $response = new HttpResponse(); @@ -263,10 +263,10 @@ trait ApiControllerPermissionTrait } /** - * @testdox A user permission can be updated * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A user permission can be updated')] public function testApiAccountPermissionUpdate() : void { $response = new HttpResponse(); diff --git a/tests/Controller/Api/ApiControllerSettingsTrait.php b/tests/Controller/Api/ApiControllerSettingsTrait.php index 17e00ab..5c4d333 100755 --- a/tests/Controller/Api/ApiControllerSettingsTrait.php +++ b/tests/Controller/Api/ApiControllerSettingsTrait.php @@ -22,10 +22,10 @@ use phpOMS\Message\Http\RequestStatusCode; trait ApiControllerSettingsTrait { /** - * @testdox Application settings can be read from the database * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('Application settings can be read from the database')] public function testApiSettingsGet() : void { $response = new HttpResponse(); @@ -39,10 +39,10 @@ trait ApiControllerSettingsTrait } /** - * @testdox Application settings can be set in the database * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('Application settings can be set in the database')] public function testApiSettingsSet() : void { $response = new HttpResponse(); @@ -62,8 +62,8 @@ trait ApiControllerSettingsTrait /** * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiAccountLocalizationLoadSet() : void { $response = new HttpResponse(); @@ -87,8 +87,8 @@ trait ApiControllerSettingsTrait /** * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiAccountLocalizationSet() : void { $response = new HttpResponse(); @@ -111,8 +111,8 @@ trait ApiControllerSettingsTrait /** * @covers \Modules\Admin\Controller\ApiController - * @group module */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testInvalidPermissionAccountLocalizationSet() : void { $response = new HttpResponse(); diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php index 238595a..4460dd1 100755 --- a/tests/Controller/ApiControllerTest.php +++ b/tests/Controller/ApiControllerTest.php @@ -36,10 +36,9 @@ use phpOMS\Router\WebRouter; use phpOMS\Utils\TestUtils; /** - * @testdox Modules\Admin\tests\Controller\ApiControllerTest: Admin api controller - * * @internal */ +#[\PHPUnit\Framework\Attributes\TestDox('Modules\Admin\tests\Controller\ApiControllerTest: Admin api controller')] final class ApiControllerTest extends \PHPUnit\Framework\TestCase { protected ApplicationAbstract $app; diff --git a/tests/Models/AccountMapperTest.php b/tests/Models/AccountMapperTest.php index 0393eb5..ffe1b6c 100755 --- a/tests/Models/AccountMapperTest.php +++ b/tests/Models/AccountMapperTest.php @@ -23,17 +23,14 @@ use phpOMS\Auth\LoginReturnType; use phpOMS\Utils\TestUtils; /** - * @testdox Modules\Admin\tests\Models\AccountMapperTest: Account database mapper - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Admin\Models\AccountMapper::class)] +#[\PHPUnit\Framework\Attributes\TestDox('Modules\Admin\tests\Models\AccountMapperTest: Account database mapper')] final class AccountMapperTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The model can be created and read from the database - * @covers \Modules\Admin\Models\AccountMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('The model can be created and read from the database')] public function testCR() : void { $account = new Account(); @@ -63,50 +60,35 @@ final class AccountMapperTest extends \PHPUnit\Framework\TestCase self::assertEquals($account->tries, $accountR->tries); } - /** - * @testdox A empty user password results in a failed login - * @covers \Modules\Admin\Models\AccountMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A empty user password results in a failed login')] public function testEmptyPasswordLogin() : void { self::assertEquals(LoginReturnType::WRONG_PASSWORD, AccountMapper::login('admin', '')); } - /** - * @testdox A invalid user password results in a failed login - * @covers \Modules\Admin\Models\AccountMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid user password results in a failed login')] public function testInvalidPasswordLogin() : void { self::assertEquals(LoginReturnType::WRONG_PASSWORD, AccountMapper::login('admin', 'invalid')); } - /** - * @testdox A invalid user name results in a failed login - * @covers \Modules\Admin\Models\AccountMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A invalid user name results in a failed login')] public function testInvalidUsernameLogin() : void { self::assertEquals(LoginReturnType::WRONG_USERNAME, AccountMapper::login('zzzzInvalidTestzzz', 'orange')); } - /** - * @testdox A valid user name and password results in a successful login - * @covers \Modules\Admin\Models\AccountMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('A valid user name and password results in a successful login')] public function testValidLogin() : void { self::assertGreaterThan(0, AccountMapper::login('admin', 'orange')); } - /** - * @covers \Modules\Admin\Models\AccountMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testInvalidLoginTries() : void { $accountR = AccountMapper::get()->where('id', 1)->execute(); @@ -119,10 +101,7 @@ final class AccountMapperTest extends \PHPUnit\Framework\TestCase AccountMapper::update()->execute($accountR); } - /** - * @covers \Modules\Admin\Models\AccountMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testInvalidLoginAccountStatus() : void { /** @var Account $accountR */ @@ -136,10 +115,7 @@ final class AccountMapperTest extends \PHPUnit\Framework\TestCase AccountMapper::update()->execute($accountR); } - /** - * @covers \Modules\Admin\Models\AccountMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testEmptyLoginPassword() : void { /** @var Account $accountR */ @@ -153,10 +129,7 @@ final class AccountMapperTest extends \PHPUnit\Framework\TestCase AccountMapper::update()->with('password')->execute($accountR); } - /** - * @covers \Modules\Admin\Models\AccountMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetWithPermission() : void { $accountR = AccountMapper::getWithPermissions(1); @@ -164,10 +137,7 @@ final class AccountMapperTest extends \PHPUnit\Framework\TestCase self::assertGreaterThan(0, $accountR->getPermissions()); } - /** - * @covers \Modules\Admin\Models\AccountMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGetWithPermissionInvalidId() : void { $accountR = AccountMapper::getWithPermissions(0); diff --git a/tests/Models/AccountPermissionTest.php b/tests/Models/AccountPermissionTest.php index afb5916..a773755 100755 --- a/tests/Models/AccountPermissionTest.php +++ b/tests/Models/AccountPermissionTest.php @@ -17,17 +17,14 @@ namespace Modules\Admin\tests\Models; use Modules\Admin\Models\AccountPermission; /** - * @testdox Modules\Admin\tests\Models\AccountPermissionTest: Account permission - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Admin\Models\AccountPermission::class)] +#[\PHPUnit\Framework\Attributes\TestDox('Modules\Admin\tests\Models\AccountPermissionTest: Account permission')] final class AccountPermissionTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The account permission has the expected default values after initialization - * @covers \Modules\Admin\Models\AccountPermission - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('The account permission has the expected default values after initialization')] public function testDefault() : void { $account = new AccountPermission(); diff --git a/tests/Models/AccountTest.php b/tests/Models/AccountTest.php index 52fb866..c5e5557 100755 --- a/tests/Models/AccountTest.php +++ b/tests/Models/AccountTest.php @@ -17,28 +17,22 @@ namespace Modules\Admin\tests\Models; use Modules\Admin\Models\Account; /** - * @testdox Modules\Admin\tests\Models\AccountTest: Account model - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Admin\Models\Account::class)] +#[\PHPUnit\Framework\Attributes\TestDox('Modules\Admin\tests\Models\AccountTest: Account model')] final class AccountTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The account has the expected default values after initialization - * @covers \Modules\Admin\Models\Account - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('The account has the expected default values after initialization')] public function testDefault() : void { $account = new Account(); self::assertEquals(0, $account->tries); } - /** - * @testdox The login tries can be set and returned - * @covers \Modules\Admin\Models\Account - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('The login tries can be set and returned')] public function testLoginTriesInputOutput() : void { $account = new Account(); diff --git a/tests/Models/AddressMapperTest.php b/tests/Models/AddressMapperTest.php index 61443a4..508bdda 100755 --- a/tests/Models/AddressMapperTest.php +++ b/tests/Models/AddressMapperTest.php @@ -19,16 +19,13 @@ use phpOMS\Stdlib\Base\Address; use phpOMS\Stdlib\Base\AddressType; /** - * @testdox Modules\Admin\tests\Models\AddressMapperTest: Address database mapper - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Admin\Models\AddressMapper::class)] +#[\PHPUnit\Framework\Attributes\TestDox('Modules\Admin\tests\Models\AddressMapperTest: Address database mapper')] final class AddressMapperTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Admin\Models\AddressMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testCR() : void { $address = new Address(); diff --git a/tests/Models/AppMapperTest.php b/tests/Models/AppMapperTest.php index a3ecda7..4803241 100755 --- a/tests/Models/AppMapperTest.php +++ b/tests/Models/AppMapperTest.php @@ -19,17 +19,14 @@ use Modules\Admin\Models\AppMapper; use phpOMS\Application\ApplicationStatus; /** - * @testdox Modules\Admin\tests\Models\AppMapperTest: App database mapper - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Admin\Models\AppMapper::class)] +#[\PHPUnit\Framework\Attributes\TestDox('Modules\Admin\tests\Models\AppMapperTest: App database mapper')] final class AppMapperTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The model can be created and read from the database - * @covers \Modules\Admin\Models\AppMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('The model can be created and read from the database')] public function testCR() : void { $app = new App(); diff --git a/tests/Models/AppTest.php b/tests/Models/AppTest.php index d81b979..f5024bc 100755 --- a/tests/Models/AppTest.php +++ b/tests/Models/AppTest.php @@ -19,16 +19,13 @@ use phpOMS\Application\ApplicationStatus; use phpOMS\Application\ApplicationType; /** - * @testdox Modules\Admin\tests\Models\AppTest: App model - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Admin\Models\App::class)] +#[\PHPUnit\Framework\Attributes\TestDox('Modules\Admin\tests\Models\AppTest: App model')] final class AppTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Admin\Models\App - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { $app = new App(); diff --git a/tests/Models/DataChangeTest.php b/tests/Models/DataChangeTest.php index c0fa1ca..11e150a 100644 --- a/tests/Models/DataChangeTest.php +++ b/tests/Models/DataChangeTest.php @@ -17,16 +17,13 @@ namespace Modules\Admin\tests\Models; use Modules\Admin\Models\DataChange; /** - * @testdox Modules\Admin\tests\Models\DataChangeTest: DataChange model - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Admin\Models\DataChange::class)] +#[\PHPUnit\Framework\Attributes\TestDox('Modules\Admin\tests\Models\DataChangeTest: DataChange model')] final class DataChangeTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Admin\Models\DataChange - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { $change = new DataChange(); diff --git a/tests/Models/GroupMapperTest.php b/tests/Models/GroupMapperTest.php index 284b9bb..ede7792 100755 --- a/tests/Models/GroupMapperTest.php +++ b/tests/Models/GroupMapperTest.php @@ -20,17 +20,14 @@ use Modules\Admin\Models\GroupPermission; use Modules\Admin\Models\GroupPermissionMapper; /** - * @testdox Modules\Admin\tests\Models\GroupMapperTest: Group mapper - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Admin\Models\GroupMapper::class)] +#[\PHPUnit\Framework\Attributes\TestDox('Modules\Admin\tests\Models\GroupMapperTest: Group mapper')] final class GroupMapperTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox All groups which have permissions for a module can be returned - * @covers \Modules\Admin\Models\GroupMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('All groups which have permissions for a module can be returned')] public function testGroupPermissionForModule() : void { $group = new Group('test'); @@ -51,10 +48,7 @@ final class GroupMapperTest extends \PHPUnit\Framework\TestCase self::assertTrue(false); } - /** - * @covers \Modules\Admin\Models\GroupMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testCountMembers() : void { self::assertEquals([3 => 1, 1 => 2], GroupMapper::countMembers()); diff --git a/tests/Models/GroupPermissionTest.php b/tests/Models/GroupPermissionTest.php index c1ceaaf..25611ef 100755 --- a/tests/Models/GroupPermissionTest.php +++ b/tests/Models/GroupPermissionTest.php @@ -17,17 +17,14 @@ namespace Modules\Admin\tests\Models; use Modules\Admin\Models\GroupPermission; /** - * @testdox Modules\Admin\tests\Models\GroupPermissionTest: Group permission - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Admin\Models\GroupPermission::class)] +#[\PHPUnit\Framework\Attributes\TestDox('Modules\Admin\tests\Models\GroupPermissionTest: Group permission')] final class GroupPermissionTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The group permission has the expected default values after initialization - * @covers \Modules\Admin\Models\GroupPermission - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('The group permission has the expected default values after initialization')] public function testDefault() : void { $group = new GroupPermission(); diff --git a/tests/Models/GroupTest.php b/tests/Models/GroupTest.php index e4c5796..22c9fc3 100755 --- a/tests/Models/GroupTest.php +++ b/tests/Models/GroupTest.php @@ -18,10 +18,10 @@ use Modules\Admin\Models\Group; use Modules\Admin\Models\NullAccount; /** - * @testdox Modules\Admin\tests\Models\GroupTest: Group model - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Admin\Models\Group::class)] +#[\PHPUnit\Framework\Attributes\TestDox('Modules\Admin\tests\Models\GroupTest: Group model')] final class GroupTest extends \PHPUnit\Framework\TestCase { protected Group $group; @@ -35,10 +35,9 @@ final class GroupTest extends \PHPUnit\Framework\TestCase } /** - * @testdox The group has the expected default values after initialization - * @covers \Modules\Admin\Models\Group * @group module */ + #[\PHPUnit\Framework\Attributes\TestDox('The group has the expected default values after initialization')] public function testDefault() : void { self::assertEquals((new \DateTime('now'))->format('Y-m-d'), $this->group->createdAt->format('Y-m-d')); @@ -48,10 +47,9 @@ final class GroupTest extends \PHPUnit\Framework\TestCase } /** - * @testdox The description can be set and returned - * @covers \Modules\Admin\Models\Group * @group module */ + #[\PHPUnit\Framework\Attributes\TestDox('The description can be set and returned')] public function testDescriptionInputOutput() : void { $this->group->descriptionRaw = 'Some test'; @@ -59,10 +57,9 @@ final class GroupTest extends \PHPUnit\Framework\TestCase } /** - * @testdox The creator can be set and returned - * @covers \Modules\Admin\Models\Group * @group module */ + #[\PHPUnit\Framework\Attributes\TestDox('The creator can be set and returned')] public function testCreatorInputOutput() : void { $this->group->createdBy = new NullAccount(3); diff --git a/tests/Models/LocalizationMapperTest.php b/tests/Models/LocalizationMapperTest.php index 5aee837..fa5444b 100755 --- a/tests/Models/LocalizationMapperTest.php +++ b/tests/Models/LocalizationMapperTest.php @@ -18,17 +18,14 @@ use Modules\Admin\Models\LocalizationMapper; use phpOMS\Localization\Localization; /** - * @testdox Modules\Admin\tests\Models\LocalizationMapperTest: Localization database mapper - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Admin\Models\LocalizationMapper::class)] +#[\PHPUnit\Framework\Attributes\TestDox('Modules\Admin\tests\Models\LocalizationMapperTest: Localization database mapper')] final class LocalizationMapperTest extends \PHPUnit\Framework\TestCase { - /** - * @testdox The model can be created and read from the database - * @covers \Modules\Admin\Models\LocalizationMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('The model can be created and read from the database')] public function testCR() : void { $localization = Localization::fromJson( diff --git a/tests/Models/ModuleTest.php b/tests/Models/ModuleTest.php index ebac4da..4724f99 100755 --- a/tests/Models/ModuleTest.php +++ b/tests/Models/ModuleTest.php @@ -18,10 +18,10 @@ use Modules\Admin\Models\Module; use phpOMS\Module\ModuleStatus; /** - * @testdox Modules\Admin\tests\Models\ModuleTest: Module container - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Admin\Models\Module::class)] +#[\PHPUnit\Framework\Attributes\TestDox('Modules\Admin\tests\Models\ModuleTest: Module container')] final class ModuleTest extends \PHPUnit\Framework\TestCase { protected Module $module; @@ -34,11 +34,8 @@ final class ModuleTest extends \PHPUnit\Framework\TestCase $this->module = new Module(); } - /** - * @testdox The module has the expected default values after initialization - * @covers \Modules\Admin\Models\Module - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('The module has the expected default values after initialization')] public function testDefault() : void { self::assertEquals('', $this->module->id); @@ -49,33 +46,24 @@ final class ModuleTest extends \PHPUnit\Framework\TestCase self::assertEquals($this->module->jsonSerialize(), $this->module->toArray()); } - /** - * @testdox The name can be set and returned - * @covers \Modules\Admin\Models\Module - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('The name can be set and returned')] public function testNameInputOutput() : void { $this->module->name = 'Name'; self::assertEquals('Name', $this->module->name); } - /** - * @testdox The status can be set and returned - * @covers \Modules\Admin\Models\Module - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('The status can be set and returned')] public function testStatusInputOutput() : void { $this->module->status = ModuleStatus::ACTIVE; self::assertEquals(ModuleStatus::ACTIVE, $this->module->status); } - /** - * @testdox The module can be serialized - * @covers \Modules\Admin\Models\Module - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\TestDox('The module can be serialized')] public function testSerializations() : void { self::assertEquals(\json_encode($this->module->jsonSerialize()), $this->module->__toString()); diff --git a/tests/Models/NullAccountExternalTest.php b/tests/Models/NullAccountExternalTest.php index 9781c81..3bb8e96 100644 --- a/tests/Models/NullAccountExternalTest.php +++ b/tests/Models/NullAccountExternalTest.php @@ -19,31 +19,23 @@ use Modules\Admin\Models\NullAccountExternal; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Admin\Models\NullAccountExternal::class)] final class NullAccountExternalTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Admin\Models\NullAccountExternal - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Admin\Models\AccountExternal', new NullAccountExternal()); } - /** - * @covers \Modules\Admin\Models\NullAccountExternal - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullAccountExternal(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Admin\Models\NullAccountExternal - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullAccountExternal(2); diff --git a/tests/Models/NullAccountPermissionTest.php b/tests/Models/NullAccountPermissionTest.php index f912f08..3003c20 100755 --- a/tests/Models/NullAccountPermissionTest.php +++ b/tests/Models/NullAccountPermissionTest.php @@ -19,31 +19,23 @@ use Modules\Admin\Models\NullAccountPermission; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Admin\Models\NullAccountPermission::class)] final class NullAccountPermissionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Admin\Models\NullAccountPermission - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Admin\Models\AccountPermission', new NullAccountPermission()); } - /** - * @covers \Modules\Admin\Models\NullAccountPermission - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullAccountPermission(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Admin\Models\NullAccountPermission - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullAccountPermission(2); diff --git a/tests/Models/NullAccountTest.php b/tests/Models/NullAccountTest.php index 61857c5..e815506 100755 --- a/tests/Models/NullAccountTest.php +++ b/tests/Models/NullAccountTest.php @@ -19,31 +19,23 @@ use Modules\Admin\Models\NullAccount; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Admin\Models\NullAccount::class)] final class NullAccountTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Admin\Models\NullAccount - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Admin\Models\Account', new NullAccount()); } - /** - * @covers \Modules\Admin\Models\NullAccount - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullAccount(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Admin\Models\NullAccount - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullAccount(2); diff --git a/tests/Models/NullAppTest.php b/tests/Models/NullAppTest.php index 363df45..9923ed7 100644 --- a/tests/Models/NullAppTest.php +++ b/tests/Models/NullAppTest.php @@ -19,31 +19,24 @@ use Modules\Admin\Models\NullApp; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Admin\Models\NullApp::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Admin\Models\NullModule::class)] final class NullAppTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Admin\Models\NullApp - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Admin\Models\App', new NullApp()); } - /** - * @covers \Modules\Admin\Models\NullApp - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullApp(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Admin\Models\NullModule - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullApp(2); diff --git a/tests/Models/NullDataChangeTest.php b/tests/Models/NullDataChangeTest.php index b6d9abb..67ed120 100644 --- a/tests/Models/NullDataChangeTest.php +++ b/tests/Models/NullDataChangeTest.php @@ -19,31 +19,23 @@ use Modules\Admin\Models\NullDataChange; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Admin\Models\NullDataChange::class)] final class NullDataChangeTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Admin\Models\NullDataChange - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Admin\Models\DataChange', new NullDataChange()); } - /** - * @covers \Modules\Admin\Models\NullDataChange - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullDataChange(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Admin\Models\NullDataChange - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullDataChange(2); diff --git a/tests/Models/NullGroupPermissionTest.php b/tests/Models/NullGroupPermissionTest.php index 8493f44..363a3e2 100755 --- a/tests/Models/NullGroupPermissionTest.php +++ b/tests/Models/NullGroupPermissionTest.php @@ -19,31 +19,24 @@ use Modules\Admin\Models\NullGroupPermission; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Admin\Models\NullGroupPermission::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Admin\Models\NullModule::class)] final class NullGroupPermissionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Admin\Models\NullGroupPermission - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Admin\Models\GroupPermission', new NullGroupPermission()); } - /** - * @covers \Modules\Admin\Models\NullGroupPermission - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullGroupPermission(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Admin\Models\NullModule - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullGroupPermission(2); diff --git a/tests/Models/NullGroupTest.php b/tests/Models/NullGroupTest.php index 52b7e0c..6999b94 100755 --- a/tests/Models/NullGroupTest.php +++ b/tests/Models/NullGroupTest.php @@ -19,31 +19,24 @@ use Modules\Admin\Models\NullGroup; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Admin\Models\NullGroup::class)] +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Admin\Models\NullModule::class)] final class NullGroupTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Admin\Models\NullGroup - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Admin\Models\Group', new NullGroup()); } - /** - * @covers \Modules\Admin\Models\NullGroup - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullGroup(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Admin\Models\NullModule - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullGroup(2); diff --git a/tests/Models/NullModuleTest.php b/tests/Models/NullModuleTest.php index bbd7bb6..0a96cd5 100755 --- a/tests/Models/NullModuleTest.php +++ b/tests/Models/NullModuleTest.php @@ -19,31 +19,23 @@ use Modules\Admin\Models\NullModule; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Admin\Models\NullModule::class)] final class NullModuleTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Admin\Models\NullModule - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Admin\Models\Module', new NullModule()); } - /** - * @covers \Modules\Admin\Models\NullModule - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullModule('Test'); self::assertEquals('Test', $null->id); } - /** - * @covers \Modules\Admin\Models\NullModule - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullModule('Test'); diff --git a/tests/phpunit_default.xml b/tests/phpunit_default.xml index 5121c45..e4a5639 100755 --- a/tests/phpunit_default.xml +++ b/tests/phpunit_default.xml @@ -1,6 +1,37 @@ - - + + + + + + + + + + ../MainRepository/Install/tests* + + + ../tests* + + + + + volume + maybe + + + + + + + + + + + + + + ../ @@ -25,33 +56,6 @@ ../**/Admin/Hooks* ../**/Admin/Install* ../Media/Files* - ../tests/Admin* - - - - - - - - ../tests* - - - - - volume - maybe - - - - - - - - - - - - - +