diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php index d68ed51..fdafa0c 100755 --- a/tests/Controller/ApiControllerTest.php +++ b/tests/Controller/ApiControllerTest.php @@ -36,6 +36,7 @@ use phpOMS\Utils\TestUtils; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Organization\Controller\ApiController::class)] final class ApiControllerTest extends \PHPUnit\Framework\TestCase { protected $app = null; @@ -86,10 +87,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase TestUtils::setMember($this->module, 'app', $this->app); } - /** - * @covers \Modules\Organization\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiUnitGet() : void { $response = new HttpResponse(); @@ -104,10 +102,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertGreaterThan(0, $response->getDataArray('')['response']->id); } - /** - * @covers \Modules\Organization\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiUnitSet() : void { $response = new HttpResponse(); @@ -123,10 +118,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertEquals('OMS', $response->getDataArray('')['response']->name); } - /** - * @covers \Modules\Organization\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiUnitFind() : void { $response = new HttpResponse(); @@ -141,10 +133,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertGreaterThan(0, $response->getData('')[0]->id); } - /** - * @covers \Modules\Organization\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiUnitCreateDelete() : void { $response = new HttpResponse(); @@ -170,10 +159,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase */ } - /** - * @covers \Modules\Organization\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiUnitCreateInvalid() : void { $response = new HttpResponse(); @@ -188,10 +174,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase protected static $departmentId = 0; - /** - * @covers \Modules\Organization\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiDepartmentCreate() : void { $response = new HttpResponse(); @@ -211,10 +194,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::$departmentId = $response->getDataArray('')['response']->id; } - /** - * @covers \Modules\Organization\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiDepartmentFind() : void { $response = new HttpResponse(); @@ -229,10 +209,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertGreaterThan(0, $response->getData('')[0]->id); } - /** - * @covers \Modules\Organization\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiDepartmentCreateInvalid() : void { $response = new HttpResponse(); @@ -245,10 +222,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertEquals(RequestStatusCode::R_400, $response->header->status); } - /** - * @covers \Modules\Organization\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiDepartmentGet() : void { $response = new HttpResponse(); @@ -263,10 +237,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertGreaterThan(0, $response->getDataArray('')['response']->id); } - /** - * @covers \Modules\Organization\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiDepartmentSet() : void { $response = new HttpResponse(); @@ -282,10 +253,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertEquals('Production', $response->getDataArray('')['response']->name); } - /** - * @covers \Modules\Organization\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiDepartmentDelete() : void { $response = new HttpResponse(); @@ -300,10 +268,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase protected static $positionId = 0; - /** - * @covers \Modules\Organization\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiPositionCreate() : void { $response = new HttpResponse(); @@ -321,10 +286,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::$positionId = $response->getDataArray('')['response']->id; } - /** - * @covers \Modules\Organization\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiPositionFind() : void { $response = new HttpResponse(); @@ -339,10 +301,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertGreaterThan(0, $response->getData('')[0]->id); } - /** - * @covers \Modules\Organization\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiPositionCreateInvalid() : void { $response = new HttpResponse(); @@ -355,10 +314,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertEquals(RequestStatusCode::R_400, $response->header->status); } - /** - * @covers \Modules\Organization\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiPositionGet() : void { $response = new HttpResponse(); @@ -373,10 +329,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertGreaterThan(0, $response->getDataArray('')['response']->id); } - /** - * @covers \Modules\Organization\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiPositionSet() : void { $response = new HttpResponse(); @@ -392,10 +345,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertEquals('Test', $response->getDataArray('')['response']->name); } - /** - * @covers \Modules\Organization\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiPositionDelete() : void { $response = new HttpResponse(); @@ -408,10 +358,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertGreaterThan(0, $response->getDataArray('')['response']->id); } - /** - * @covers \Modules\Organization\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiUnitImageSet() : void { \copy(__DIR__ . '/icon.png', __DIR__ . '/temp_icon.png'); @@ -438,10 +385,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase self::assertEquals('Organization Logo', $image->name); } - /** - * @covers \Modules\Organization\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiUnitImageSetInvalid() : void { $response = new HttpResponse(); diff --git a/tests/Models/DepartmentMapperTest.php b/tests/Models/DepartmentMapperTest.php index 28bb43e..115bd86 100755 --- a/tests/Models/DepartmentMapperTest.php +++ b/tests/Models/DepartmentMapperTest.php @@ -22,12 +22,10 @@ use Modules\Organization\Models\NullUnit; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Organization\Models\DepartmentMapper::class)] final class DepartmentMapperTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Organization\Models\DepartmentMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testCRUD() : void { $department = new Department(); @@ -46,11 +44,11 @@ final class DepartmentMapperTest extends \PHPUnit\Framework\TestCase } /** - * @group volume * @slowThreshold 15000 - * @group module - * @coversNothing */ + #[\PHPUnit\Framework\Attributes\Group('volume')] + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testVolume() : void { $first = 2; diff --git a/tests/Models/DepartmentTest.php b/tests/Models/DepartmentTest.php index 5208818..a2255d6 100755 --- a/tests/Models/DepartmentTest.php +++ b/tests/Models/DepartmentTest.php @@ -22,6 +22,7 @@ use Modules\Organization\Models\Status; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Organization\Models\Department::class)] final class DepartmentTest extends \PHPUnit\Framework\TestCase { private Department $department; @@ -34,10 +35,7 @@ final class DepartmentTest extends \PHPUnit\Framework\TestCase $this->department = new Department(); } - /** - * @covers \Modules\Organization\Models\Department - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { self::assertEquals(0, $this->department->id); @@ -49,60 +47,42 @@ final class DepartmentTest extends \PHPUnit\Framework\TestCase self::assertEquals(Status::INACTIVE, $this->department->status); } - /** - * @covers \Modules\Organization\Models\Department - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNameInputOutput() : void { $this->department->name = 'Name'; self::assertEquals('Name', $this->department->name); } - /** - * @covers \Modules\Organization\Models\Department - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDescriptionInputOutput() : void { $this->department->description = 'Description'; self::assertEquals('Description', $this->department->description); } - /** - * @covers \Modules\Organization\Models\Department - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDescriptionRawInputOutput() : void { $this->department->descriptionRaw = 'DescriptionRaw'; self::assertEquals('DescriptionRaw', $this->department->descriptionRaw); } - /** - * @covers \Modules\Organization\Models\Department - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testParentInputOutput() : void { $this->department->parent = new NullDepartment(1); self::assertEquals(1, $this->department->parent->id); } - /** - * @covers \Modules\Organization\Models\Department - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testUnitInputOutput() : void { $this->department->unit = new NullUnit(1); self::assertEquals(1, $this->department->unit->id); } - /** - * @covers \Modules\Organization\Models\Department - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testSerialize() : void { $this->department->name = 'Name'; diff --git a/tests/Models/NullDepartmentTest.php b/tests/Models/NullDepartmentTest.php index 727ed4c..52a8915 100755 --- a/tests/Models/NullDepartmentTest.php +++ b/tests/Models/NullDepartmentTest.php @@ -19,31 +19,23 @@ use Modules\Organization\Models\NullDepartment; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Organization\Models\NullDepartment::class)] final class NullDepartmentTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Organization\Models\NullDepartment - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Organization\Models\Department', new NullDepartment()); } - /** - * @covers \Modules\Organization\Models\NullDepartment - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullDepartment(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Organization\Models\NullDepartment - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullDepartment(2); diff --git a/tests/Models/NullPositionTest.php b/tests/Models/NullPositionTest.php index 873a272..65aeb7f 100755 --- a/tests/Models/NullPositionTest.php +++ b/tests/Models/NullPositionTest.php @@ -19,31 +19,23 @@ use Modules\Organization\Models\NullPosition; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Organization\Models\NullPosition::class)] final class NullPositionTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Organization\Models\NullPosition - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Organization\Models\Position', new NullPosition()); } - /** - * @covers \Modules\Organization\Models\NullPosition - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullPosition(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Organization\Models\NullPosition - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullPosition(2); diff --git a/tests/Models/NullUnitTest.php b/tests/Models/NullUnitTest.php index 13ecf39..6b134fd 100755 --- a/tests/Models/NullUnitTest.php +++ b/tests/Models/NullUnitTest.php @@ -19,31 +19,23 @@ use Modules\Organization\Models\NullUnit; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Organization\Models\NullUnit::class)] final class NullUnitTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Organization\Models\NullUnit - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Organization\Models\Unit', new NullUnit()); } - /** - * @covers \Modules\Organization\Models\NullUnit - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullUnit(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Organization\Models\NullUnit - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullUnit(2); diff --git a/tests/Models/PositionMapperTest.php b/tests/Models/PositionMapperTest.php index 037956b..fa7e700 100755 --- a/tests/Models/PositionMapperTest.php +++ b/tests/Models/PositionMapperTest.php @@ -21,12 +21,10 @@ use Modules\Organization\Models\PositionMapper; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Organization\Models\PositionMapper::class)] final class PositionMapperTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Organization\Models\PositionMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testCRUD() : void { $position = new Position(); @@ -43,11 +41,11 @@ final class PositionMapperTest extends \PHPUnit\Framework\TestCase } /** - * @group volume * @slowThreshold 15000 - * @group module - * @coversNothing */ + #[\PHPUnit\Framework\Attributes\Group('volume')] + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testVolume() : void { $first = 2; diff --git a/tests/Models/PositionTest.php b/tests/Models/PositionTest.php index 05fb319..c36cb00 100755 --- a/tests/Models/PositionTest.php +++ b/tests/Models/PositionTest.php @@ -22,6 +22,7 @@ use Modules\Organization\Models\Status; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Organization\Models\Position::class)] final class PositionTest extends \PHPUnit\Framework\TestCase { private Position $position; @@ -34,10 +35,7 @@ final class PositionTest extends \PHPUnit\Framework\TestCase $this->position = new Position(); } - /** - * @covers \Modules\Organization\Models\Position - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { self::assertEquals(0, $this->position->id); @@ -49,60 +47,42 @@ final class PositionTest extends \PHPUnit\Framework\TestCase self::assertEquals(Status::INACTIVE, $this->position->status); } - /** - * @covers \Modules\Organization\Models\Position - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNameInputOutput() : void { $this->position->name = 'Name'; self::assertEquals('Name', $this->position->name); } - /** - * @covers \Modules\Organization\Models\Position - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDescriptionInputOutput() : void { $this->position->description = 'Description'; self::assertEquals('Description', $this->position->description); } - /** - * @covers \Modules\Organization\Models\Position - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDescriptionRawInputOutput() : void { $this->position->descriptionRaw = 'DescriptionRaw'; self::assertEquals('DescriptionRaw', $this->position->descriptionRaw); } - /** - * @covers \Modules\Organization\Models\Position - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testParentInputOutput() : void { $this->position->parent = new NullPosition(1); self::assertEquals(1, $this->position->parent->id); } - /** - * @covers \Modules\Organization\Models\Position - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDepartmentInputOutput() : void { $this->position->department = new NullDepartment(1); self::assertEquals(1, $this->position->department->id); } - /** - * @covers \Modules\Organization\Models\Position - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testSerialize() : void { $this->position->name = 'Name'; diff --git a/tests/Models/UnitMapperTest.php b/tests/Models/UnitMapperTest.php index 56aa95f..c8aa8af 100755 --- a/tests/Models/UnitMapperTest.php +++ b/tests/Models/UnitMapperTest.php @@ -21,12 +21,10 @@ use Modules\Organization\Models\UnitMapper; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Organization\Models\UnitMapper::class)] final class UnitMapperTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Organization\Models\UnitMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testCRUD() : void { $unit = new Unit(); diff --git a/tests/Models/UnitTest.php b/tests/Models/UnitTest.php index 16d2b35..a43fbff 100755 --- a/tests/Models/UnitTest.php +++ b/tests/Models/UnitTest.php @@ -22,6 +22,7 @@ use Modules\Organization\Models\Unit; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Organization\Models\Unit::class)] final class UnitTest extends \PHPUnit\Framework\TestCase { private Unit $unit; @@ -34,10 +35,7 @@ final class UnitTest extends \PHPUnit\Framework\TestCase $this->unit = new Unit(); } - /** - * @covers \Modules\Organization\Models\Unit - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { self::assertEquals(0, $this->unit->id); @@ -49,60 +47,42 @@ final class UnitTest extends \PHPUnit\Framework\TestCase self::assertEquals(Status::INACTIVE, $this->unit->status); } - /** - * @covers \Modules\Organization\Models\Unit - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNameInputOutput() : void { $this->unit->name = 'Name'; self::assertEquals('Name', $this->unit->name); } - /** - * @covers \Modules\Organization\Models\Unit - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDescriptionInputOutput() : void { $this->unit->description = 'Description'; self::assertEquals('Description', $this->unit->description); } - /** - * @covers \Modules\Organization\Models\Unit - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDescriptionRawInputOutput() : void { $this->unit->descriptionRaw = 'DescriptionRaw'; self::assertEquals('DescriptionRaw', $this->unit->descriptionRaw); } - /** - * @covers \Modules\Organization\Models\Unit - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testParentInputOutput() : void { $this->unit->parent = new NullUnit(1); self::assertEquals(1, $this->unit->parent->id); } - /** - * @covers \Modules\Organization\Models\Unit - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testImageInputOutput() : void { $this->unit->image = new NullMedia(1); self::assertEquals(1, $this->unit->image->id); } - /** - * @covers \Modules\Organization\Models\Unit - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testSerialize() : void { $this->unit->name = 'Name'; 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* + +