diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php index 6faf2ed..d5465a4 100755 --- a/tests/Controller/ApiControllerTest.php +++ b/tests/Controller/ApiControllerTest.php @@ -40,10 +40,10 @@ use phpOMS\Utils\RnG\DateTime; use phpOMS\Utils\TestUtils; /** - * @testdox Modules\HumanResourceManagement\tests\Controller\ApiControllerTest: HumanResourceManagement api controller - * * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\HumanResourceManagement\Controller\ApiController::class)] +#[\PHPUnit\Framework\Attributes\TestDox('Modules\HumanResourceManagement\tests\Controller\ApiControllerTest: HumanResourceManagement api controller')] final class ApiControllerTest extends \PHPUnit\Framework\TestCase { protected ApplicationAbstract $app; @@ -114,10 +114,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase TestUtils::setMember($this->module, 'app', $this->app); } - /** - * @covers \Modules\HumanResourceManagement\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testEmployeeFromAccountCreate() : void { $response = new HttpResponse(); @@ -131,10 +128,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertGreaterThan(0, self::$employee = $response->getDataArray('')['response'][0]->id); } - /** - * @covers \Modules\HumanResourceManagement\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNewEmployeeCreate() : void { $response = new HttpResponse(); @@ -147,10 +141,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertGreaterThan(0, self::$employee = $response->getDataArray('')['response']->id); } - /** - * @covers \Modules\HumanResourceManagement\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiEmployeeCreateInvalidData() : void { $response = new HttpResponse(); @@ -163,10 +154,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertEquals(RequestStatusCode::R_400, $response->header->status); } - /** - * @covers \Modules\HumanResourceManagement\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testEmployeeCreateFromAccountInvalidData() : void { $response = new HttpResponse(); @@ -179,10 +167,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertEquals(RequestStatusCode::R_400, $response->header->status); } - /** - * @covers \Modules\HumanResourceManagement\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNewEmployeeCreateInvalidData() : void { $response = new HttpResponse(); @@ -195,11 +180,8 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertEquals(RequestStatusCode::R_400, $response->header->status); } - /** - * @depends testEmployeeFromAccountCreate - * @covers \Modules\HumanResourceManagement\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Depends('testEmployeeFromAccountCreate')] + #[\PHPUnit\Framework\Attributes\Group('module')] public function testEmployeeHistoryCreate() : void { $start = DateTime::generateDateTime( @@ -234,10 +216,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase } } - /** - * @covers \Modules\HumanResourceManagement\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testEmployeeHistoryCreateInvalidData() : void { $response = new HttpResponse(); @@ -250,11 +229,8 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertEquals(RequestStatusCode::R_400, $response->header->status); } - /** - * @depends testEmployeeFromAccountCreate - * @covers \Modules\HumanResourceManagement\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Depends('testEmployeeFromAccountCreate')] + #[\PHPUnit\Framework\Attributes\Group('module')] public function testEmployeeWorkHistoryCreate() : void { $start = DateTime::generateDateTime( @@ -294,10 +270,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase } } - /** - * @covers \Modules\HumanResourceManagement\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testEmployeeWorkHistoryCreateInvalidData() : void { $response = new HttpResponse(); @@ -310,11 +283,8 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertEquals(RequestStatusCode::R_400, $response->header->status); } - /** - * @depends testEmployeeFromAccountCreate - * @covers \Modules\HumanResourceManagement\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Depends('testEmployeeFromAccountCreate')] + #[\PHPUnit\Framework\Attributes\Group('module')] public function testEmployeeEducationHistoryCreate() : void { $start = DateTime::generateDateTime( @@ -355,10 +325,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase } } - /** - * @covers \Modules\HumanResourceManagement\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testEmployeeEducationHistoryCreateInvalidData() : void { $response = new HttpResponse(); diff --git a/tests/Models/EmployeeEducationHistoryTest.php b/tests/Models/EmployeeEducationHistoryTest.php index 494a537..84ab38d 100755 --- a/tests/Models/EmployeeEducationHistoryTest.php +++ b/tests/Models/EmployeeEducationHistoryTest.php @@ -19,6 +19,7 @@ use Modules\HumanResourceManagement\Models\EmployeeEducationHistory; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\HumanResourceManagement\Models\EmployeeEducationHistory::class)] final class EmployeeEducationHistoryTest extends \PHPUnit\Framework\TestCase { private EmployeeEducationHistory $history; @@ -31,10 +32,7 @@ final class EmployeeEducationHistoryTest extends \PHPUnit\Framework\TestCase $this->history = new EmployeeEducationHistory(); } - /** - * @covers \Modules\HumanResourceManagement\Models\EmployeeEducationHistory - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { self::assertEquals(0, $this->history->id); @@ -47,10 +45,7 @@ final class EmployeeEducationHistoryTest extends \PHPUnit\Framework\TestCase self::assertInstanceOf('\phpOMS\Stdlib\Base\Address', $this->history->address); } - /** - * @covers \Modules\HumanResourceManagement\Models\EmployeeEducationHistory - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testSerialize() : void { $this->history->employee = 2; diff --git a/tests/Models/EmployeeHistoryMapperTest.php b/tests/Models/EmployeeHistoryMapperTest.php index 790a2ba..5127e7a 100755 --- a/tests/Models/EmployeeHistoryMapperTest.php +++ b/tests/Models/EmployeeHistoryMapperTest.php @@ -22,12 +22,10 @@ use Modules\Profile\Models\ProfileMapper; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\HumanResourceManagement\Models\EmployeeHistoryMapper::class)] final class EmployeeHistoryMapperTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\HumanResourceManagement\Models\EmployeeHistoryMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testCRUD() : void { $employee = new Employee(ProfileMapper::get()->where('id', 1)->execute()); diff --git a/tests/Models/EmplyeeHistoryTest.php b/tests/Models/EmployeeHistoryTest.php old mode 100755 new mode 100644 similarity index 88% rename from tests/Models/EmplyeeHistoryTest.php rename to tests/Models/EmployeeHistoryTest.php index a944d68..cf0ed49 --- a/tests/Models/EmplyeeHistoryTest.php +++ b/tests/Models/EmployeeHistoryTest.php @@ -19,6 +19,7 @@ use Modules\HumanResourceManagement\Models\EmployeeHistory; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\HumanResourceManagement\Models\EmployeeHistory::class)] final class EmployeeHistoryTest extends \PHPUnit\Framework\TestCase { private EmployeeHistory $history; @@ -31,10 +32,7 @@ final class EmployeeHistoryTest extends \PHPUnit\Framework\TestCase $this->history = new EmployeeHistory(); } - /** - * @covers \Modules\HumanResourceManagement\Models\EmployeeHistory - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { self::assertEquals(0, $this->history->id); @@ -46,10 +44,7 @@ final class EmployeeHistoryTest extends \PHPUnit\Framework\TestCase self::assertInstanceOf('\DateTime', $this->history->start); } - /** - * @covers \Modules\HumanResourceManagement\Models\EmployeeHistory - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testSerialize() : void { $this->history->employee = 2; diff --git a/tests/Models/EmployeeMapperTest.php b/tests/Models/EmployeeMapperTest.php index d04cd1f..fd1e96c 100755 --- a/tests/Models/EmployeeMapperTest.php +++ b/tests/Models/EmployeeMapperTest.php @@ -23,12 +23,10 @@ use Modules\Profile\Models\ProfileMapper; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\HumanResourceManagement\Models\EmployeeMapper::class)] final class EmployeeMapperTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\HumanResourceManagement\Models\EmployeeMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testCR() : void { if (($profile = ProfileMapper::get()->where('account', 1)->execute())->id === 0) { diff --git a/tests/Models/EmployeeTest.php b/tests/Models/EmployeeTest.php index 3da5aaf..384bc64 100755 --- a/tests/Models/EmployeeTest.php +++ b/tests/Models/EmployeeTest.php @@ -22,6 +22,7 @@ use Modules\HumanResourceManagement\Models\EmployeeWorkHistory; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\HumanResourceManagement\Models\Employee::class)] final class EmployeeTest extends \PHPUnit\Framework\TestCase { private Employee $employee; @@ -34,10 +35,7 @@ final class EmployeeTest extends \PHPUnit\Framework\TestCase $this->employee = new Employee(); } - /** - * @covers \Modules\HumanResourceManagement\Models\Employee - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { self::assertEquals(0, $this->employee->id); @@ -50,10 +48,7 @@ final class EmployeeTest extends \PHPUnit\Framework\TestCase self::assertEquals([], $this->employee->getWorkHistory()); } - /** - * @covers \Modules\HumanResourceManagement\Models\Employee - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testPrivateHashInputOutput() : void { $temp = $this->employee->getSemiPrivateHash(); @@ -62,10 +57,7 @@ final class EmployeeTest extends \PHPUnit\Framework\TestCase self::assertFalse($this->employee->compareSemiPrivateHash($temp)); } - /** - * @covers \Modules\HumanResourceManagement\Models\Employee - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testHistoryInputOutput() : void { $this->employee->addHistory($a = new EmployeeHistory()); @@ -74,10 +66,7 @@ final class EmployeeTest extends \PHPUnit\Framework\TestCase self::assertEquals($b, $this->employee->getNewestHistory()); } - /** - * @covers \Modules\HumanResourceManagement\Models\Employee - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testWorkHistoryInputOutput() : void { $this->employee->addWorkHistory($a = new EmployeeWorkHistory()); @@ -86,10 +75,7 @@ final class EmployeeTest extends \PHPUnit\Framework\TestCase self::assertEquals($b, $this->employee->getNewestWorkHistory()); } - /** - * @covers \Modules\HumanResourceManagement\Models\Employee - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testEducationHistoryInputOutput() : void { $this->employee->addEducationHistory($a = new EmployeeEducationHistory()); @@ -98,10 +84,7 @@ final class EmployeeTest extends \PHPUnit\Framework\TestCase self::assertEquals($b, $this->employee->getNewestEducationHistory()); } - /** - * @covers \Modules\HumanResourceManagement\Models\Employee - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testSerialize() : void { $serialized = $this->employee->jsonSerialize(); diff --git a/tests/Models/EmployeeWorkHistoryTest.php b/tests/Models/EmployeeWorkHistoryTest.php index 682f94d..2823d5c 100755 --- a/tests/Models/EmployeeWorkHistoryTest.php +++ b/tests/Models/EmployeeWorkHistoryTest.php @@ -19,6 +19,7 @@ use Modules\HumanResourceManagement\Models\EmployeeWorkHistory; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\HumanResourceManagement\Models\EmployeeWorkHistory::class)] final class EmployeeWorkHistoryTest extends \PHPUnit\Framework\TestCase { private EmployeeWorkHistory $history; @@ -31,10 +32,7 @@ final class EmployeeWorkHistoryTest extends \PHPUnit\Framework\TestCase $this->history = new EmployeeWorkHistory(); } - /** - * @covers \Modules\HumanResourceManagement\Models\EmployeeWorkHistory - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { self::assertEquals(0, $this->history->id); @@ -45,10 +43,7 @@ final class EmployeeWorkHistoryTest extends \PHPUnit\Framework\TestCase self::assertInstanceOf('\phpOMS\Stdlib\Base\Address', $this->history->address); } - /** - * @covers \Modules\HumanResourceManagement\Models\EmployeeWorkHistory - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testSerialize() : void { $this->history->employee = 2; diff --git a/tests/Models/NullEmployeeEducationHistoryTest.php b/tests/Models/NullEmployeeEducationHistoryTest.php index 381c63b..a74f172 100755 --- a/tests/Models/NullEmployeeEducationHistoryTest.php +++ b/tests/Models/NullEmployeeEducationHistoryTest.php @@ -19,31 +19,23 @@ use Modules\HumanResourceManagement\Models\NullEmployeeEducationHistory; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\HumanResourceManagement\Models\NullEmployeeEducationHistory::class)] final class NullEmployeeEducationHistoryTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\HumanResourceManagement\Models\NullEmployeeEducationHistory - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\HumanResourceManagement\Models\EmployeeEducationHistory', new NullEmployeeEducationHistory()); } - /** - * @covers \Modules\HumanResourceManagement\Models\NullEmployeeEducationHistory - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullEmployeeEducationHistory(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\HumanResourceManagement\Models\NullEmployeeEducationHistory - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullEmployeeEducationHistory(2); diff --git a/tests/Models/NullEmployeeHistoryTest.php b/tests/Models/NullEmployeeHistoryTest.php index 59a2ac4..13d75f4 100755 --- a/tests/Models/NullEmployeeHistoryTest.php +++ b/tests/Models/NullEmployeeHistoryTest.php @@ -19,31 +19,23 @@ use Modules\HumanResourceManagement\Models\NullEmployeeHistory; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\HumanResourceManagement\Models\NullEmployeeHistory::class)] final class NullEmployeeHistoryTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\HumanResourceManagement\Models\NullEmployeeHistory - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\HumanResourceManagement\Models\EmployeeHistory', new NullEmployeeHistory()); } - /** - * @covers \Modules\HumanResourceManagement\Models\NullEmployeeHistory - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullEmployeeHistory(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\HumanResourceManagement\Models\NullEmployeeHistory - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullEmployeeHistory(2); diff --git a/tests/Models/NullEmployeeTest.php b/tests/Models/NullEmployeeTest.php index e221e54..288181d 100755 --- a/tests/Models/NullEmployeeTest.php +++ b/tests/Models/NullEmployeeTest.php @@ -19,31 +19,23 @@ use Modules\HumanResourceManagement\Models\NullEmployee; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\HumanResourceManagement\Models\NullEmployee::class)] final class NullEmployeeTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\HumanResourceManagement\Models\NullEmployee - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\HumanResourceManagement\Models\Employee', new NullEmployee()); } - /** - * @covers \Modules\HumanResourceManagement\Models\NullEmployee - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullEmployee(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\HumanResourceManagement\Models\NullEmployee - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullEmployee(2); diff --git a/tests/Models/NullEmployeeWorkHistoryTest.php b/tests/Models/NullEmployeeWorkHistoryTest.php index 8eef837..e1f8295 100755 --- a/tests/Models/NullEmployeeWorkHistoryTest.php +++ b/tests/Models/NullEmployeeWorkHistoryTest.php @@ -19,31 +19,23 @@ use Modules\HumanResourceManagement\Models\NullEmployeeWorkHistory; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\HumanResourceManagement\Models\NullEmployeeWorkHistory::class)] final class NullEmployeeWorkHistoryTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\HumanResourceManagement\Models\NullEmployeeWorkHistory - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\HumanResourceManagement\Models\EmployeeWorkHistory', new NullEmployeeWorkHistory()); } - /** - * @covers \Modules\HumanResourceManagement\Models\NullEmployeeWorkHistory - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullEmployeeWorkHistory(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\HumanResourceManagement\Models\NullEmployeeWorkHistory - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullEmployeeWorkHistory(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* + +