From 40a5ad12f8fcc02d209a75dc698341fd00624cd2 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 20 Mar 2024 05:16:00 +0000 Subject: [PATCH] upgrade phpunit --- tests/Controller/ApiControllerTest.php | 43 +++--------- tests/Controller/BackendControllerTest.php | 6 +- tests/Models/AccountRelationTest.php | 11 +-- tests/Models/GroupRelationTest.php | 11 +-- tests/Models/NullAccountRelationTest.php | 16 ++--- tests/Models/NullGroupRelationTest.php | 16 ++--- tests/Models/NullTaskElementTest.php | 16 ++--- tests/Models/NullTaskSeenTest.php | 16 ++--- tests/Models/NullTaskTest.php | 16 ++--- tests/Models/RelationAbstractTest.php | 11 +-- tests/Models/TaskElementTest.php | 76 +++++--------------- tests/Models/TaskMapperTest.php | 40 ++++------- tests/Models/TaskTest.php | 81 +++++----------------- tests/Views/TaskViewTest.php | 11 +-- tests/phpunit_default.xml | 56 +++++++-------- 15 files changed, 119 insertions(+), 307 deletions(-) diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php index 7fab16d..199fd93 100755 --- a/tests/Controller/ApiControllerTest.php +++ b/tests/Controller/ApiControllerTest.php @@ -36,7 +36,8 @@ /** * @internal */ -final class ControllerTest extends \PHPUnit\Framework\TestCase +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Tasks\Controller\ApiController::class)] +final class ApiControllerTest extends \PHPUnit\Framework\TestCase { protected $app = null; @@ -86,10 +87,7 @@ protected function setUp() : void TestUtils::setMember($this->module, 'app', $this->app); } - /** - * @covers \Modules\Tasks\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testCreateTask() : void { $response = new HttpResponse(); @@ -123,10 +121,7 @@ public function testCreateTask() : void self::assertGreaterThan(0, $response->getDataArray('')['response']->id); } - /** - * @covers \Modules\Tasks\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiTaskGet() : void { $response = new HttpResponse(); @@ -140,10 +135,7 @@ public function testApiTaskGet() : void self::assertEquals(1, $response->getDataArray('')['response']->id); } - /** - * @covers \Modules\Tasks\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiTaskSet() : void { $response = new HttpResponse(); @@ -160,10 +152,7 @@ public function testApiTaskSet() : void self::assertEquals('New Title', $response->getDataArray('')['response']->title); } - /** - * @covers \Modules\Tasks\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testCreateTaskElement() : void { $response = new HttpResponse(); @@ -198,10 +187,7 @@ public function testCreateTaskElement() : void self::assertGreaterThan(0, $response->getDataArray('')['response']->id); } - /** - * @covers \Modules\Tasks\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiTaskElementGet() : void { $response = new HttpResponse(); @@ -215,10 +201,7 @@ public function testApiTaskElementGet() : void self::assertEquals(1, $response->getDataArray('')['response']->id); } - /** - * @covers \Modules\Tasks\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testApiTaskElementSet() : void { $response = new HttpResponse(); @@ -234,10 +217,7 @@ public function testApiTaskElementSet() : void self::assertEquals('This is a changed description', $response->getDataArray('')['response']->descriptionRaw); } - /** - * @covers \Modules\Tasks\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testInvalidTaskCreate() : void { $response = new HttpResponse(); @@ -251,10 +231,7 @@ public function testInvalidTaskCreate() : void self::assertEquals(RequestStatusCode::R_400, $response->header->status); } - /** - * @covers \Modules\Tasks\Controller\ApiController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testInvalidTaskElementCreate() : void { $response = new HttpResponse(); diff --git a/tests/Controller/BackendControllerTest.php b/tests/Controller/BackendControllerTest.php index 100c83b..33c49ab 100755 --- a/tests/Controller/BackendControllerTest.php +++ b/tests/Controller/BackendControllerTest.php @@ -29,6 +29,7 @@ /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Tasks\Controller\BackendController::class)] final class BackendControllerTest extends \PHPUnit\Framework\TestCase { protected $app = null; @@ -78,10 +79,7 @@ protected function setUp() : void TestUtils::setMember($this->module, 'app', $this->app); } - /** - * @covers \Modules\Tasks\Controller\BackendController - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNavigation() : void { self::assertEquals(0, $this->module->openNav(999)); diff --git a/tests/Models/AccountRelationTest.php b/tests/Models/AccountRelationTest.php index 003c4f3..12c79eb 100755 --- a/tests/Models/AccountRelationTest.php +++ b/tests/Models/AccountRelationTest.php @@ -21,12 +21,10 @@ /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Tasks\Models\AccountRelation::class)] final class AccountRelationTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Tasks\Models\AccountRelation - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { $obj = new AccountRelation(); @@ -35,10 +33,7 @@ public function testDefault() : void self::assertEquals(DutyType::TO, $obj->getDuty()); } - /** - * @covers \Modules\Tasks\Models\AccountRelation - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testSetGet() : void { $obj = new AccountRelation($a = new NullAccount(1), DutyType::CC); diff --git a/tests/Models/GroupRelationTest.php b/tests/Models/GroupRelationTest.php index 47c8c24..20a44da 100755 --- a/tests/Models/GroupRelationTest.php +++ b/tests/Models/GroupRelationTest.php @@ -21,12 +21,10 @@ /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Tasks\Models\GroupRelation::class)] final class GroupRelationTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Tasks\Models\GroupRelation - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { $obj = new GroupRelation(); @@ -35,10 +33,7 @@ public function testDefault() : void self::assertEquals(DutyType::TO, $obj->getDuty()); } - /** - * @covers \Modules\Tasks\Models\GroupRelation - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testSetGet() : void { $obj = new GroupRelation($g = new NullGroup(1), DutyType::CC); diff --git a/tests/Models/NullAccountRelationTest.php b/tests/Models/NullAccountRelationTest.php index 5848894..d0743df 100644 --- a/tests/Models/NullAccountRelationTest.php +++ b/tests/Models/NullAccountRelationTest.php @@ -19,31 +19,23 @@ /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Tasks\Models\NullAccountRelation::class)] final class NullAccountRelationTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Tasks\Models\NullAccountRelation - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Tasks\Models\AccountRelation', new NullAccountRelation()); } - /** - * @covers \Modules\Tasks\Models\NullAccountRelation - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullAccountRelation(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Tasks\Models\NullAccountRelation - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullAccountRelation(2); diff --git a/tests/Models/NullGroupRelationTest.php b/tests/Models/NullGroupRelationTest.php index 01aa1b8..6750351 100644 --- a/tests/Models/NullGroupRelationTest.php +++ b/tests/Models/NullGroupRelationTest.php @@ -19,31 +19,23 @@ /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Tasks\Models\NullGroupRelation::class)] final class NullGroupRelationTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Tasks\Models\NullGroupRelation - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Tasks\Models\GroupRelation', new NullGroupRelation()); } - /** - * @covers \Modules\Tasks\Models\NullGroupRelation - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullGroupRelation(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Tasks\Models\NullGroupRelation - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullGroupRelation(2); diff --git a/tests/Models/NullTaskElementTest.php b/tests/Models/NullTaskElementTest.php index 6a28e9d..10e1efc 100755 --- a/tests/Models/NullTaskElementTest.php +++ b/tests/Models/NullTaskElementTest.php @@ -19,31 +19,23 @@ /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Tasks\Models\NullTaskElement::class)] final class NullTaskElementTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Tasks\Models\NullTaskElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Tasks\Models\TaskElement', new NullTaskElement()); } - /** - * @covers \Modules\Tasks\Models\NullTaskElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullTaskElement(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Tasks\Models\NullTaskElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullTaskElement(2); diff --git a/tests/Models/NullTaskSeenTest.php b/tests/Models/NullTaskSeenTest.php index c7cad69..d4126ab 100644 --- a/tests/Models/NullTaskSeenTest.php +++ b/tests/Models/NullTaskSeenTest.php @@ -19,31 +19,23 @@ /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Tasks\Models\NullTaskSeen::class)] final class NullTaskSeenTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Tasks\Models\NullTaskSeen - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Tasks\Models\TaskSeen', new NullTaskSeen()); } - /** - * @covers \Modules\Tasks\Models\NullTaskSeen - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullTaskSeen(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Tasks\Models\NullTaskSeen - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullTaskSeen(2); diff --git a/tests/Models/NullTaskTest.php b/tests/Models/NullTaskTest.php index c05bcd5..cf75325 100755 --- a/tests/Models/NullTaskTest.php +++ b/tests/Models/NullTaskTest.php @@ -19,31 +19,23 @@ /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Tasks\Models\NullTask::class)] final class NullTaskTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Tasks\Models\NullTask - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\Tasks\Models\Task', new NullTask()); } - /** - * @covers \Modules\Tasks\Models\NullTask - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullTask(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\Tasks\Models\NullTask - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullTask(2); diff --git a/tests/Models/RelationAbstractTest.php b/tests/Models/RelationAbstractTest.php index c69ed8c..845013b 100755 --- a/tests/Models/RelationAbstractTest.php +++ b/tests/Models/RelationAbstractTest.php @@ -20,6 +20,7 @@ /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Tasks\Models\RelationAbstract::class)] final class RelationAbstractTest extends \PHPUnit\Framework\TestCase { private RelationAbstract $rel; @@ -37,20 +38,14 @@ public function jsonSerialize() : mixed { return []; } }; } - /** - * @covers \Modules\Tasks\Models\RelationAbstract - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { self::assertEquals(0, $this->rel->id); self::assertEquals(DutyType::TO, $this->rel->getDuty()); } - /** - * @covers \Modules\Tasks\Models\RelationAbstract - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDutyInputOutput() : void { $this->rel->setDuty(DutyType::CC); diff --git a/tests/Models/TaskElementTest.php b/tests/Models/TaskElementTest.php index c7d032d..c5d2ba2 100755 --- a/tests/Models/TaskElementTest.php +++ b/tests/Models/TaskElementTest.php @@ -23,6 +23,7 @@ /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Tasks\Models\TaskElement::class)] final class TaskElementTest extends \PHPUnit\Framework\TestCase { private TaskElement $element; @@ -35,10 +36,7 @@ protected function setUp() : void $this->element = new TaskElement(); } - /** - * @covers \Modules\Tasks\Models\TaskElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { self::assertEquals(0, $this->element->id); @@ -54,60 +52,42 @@ public function testDefault() : void self::assertEquals(TaskPriority::NONE, $this->element->priority); } - /** - * @covers \Modules\Tasks\Models\TaskElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testCreatedByInputOutput() : void { $this->element->createdBy = new NullAccount(1); self::assertEquals(1, $this->element->createdBy->id); } - /** - * @covers \Modules\Tasks\Models\TaskElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDueInputOutput() : void { $this->element->due = ($date = new \DateTime('2000-05-07')); self::assertEquals($date->format('Y-m-d'), $this->element->due->format('Y-m-d')); } - /** - * @covers \Modules\Tasks\Models\TaskElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDescriptionInputOutput() : void { $this->element->description = 'Description'; self::assertEquals('Description', $this->element->description); } - /** - * @covers \Modules\Tasks\Models\TaskElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDescriptionRawInputOutput() : void { $this->element->descriptionRaw = 'DescriptionRaw'; self::assertEquals('DescriptionRaw', $this->element->descriptionRaw); } - /** - * @covers \Modules\Tasks\Models\TaskElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testTaskInputOutput() : void { $this->element->task = 2; self::assertEquals(2, $this->element->task); } - /** - * @covers \Modules\Tasks\Models\TaskElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testAccountToInputOutput() : void { $this->element->addTo(new NullAccount(3)); @@ -118,10 +98,7 @@ public function testAccountToInputOutput() : void self::assertCount(2, $this->element->getTo()); } - /** - * @covers \Modules\Tasks\Models\TaskElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGroupToInputOutput() : void { $this->element->addGroupTo(new NullGroup(4)); @@ -132,10 +109,7 @@ public function testGroupToInputOutput() : void self::assertCount(2, $this->element->getTo()); } - /** - * @covers \Modules\Tasks\Models\TaskElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testAccountCCInputOutput() : void { $this->element->addCC(new NullAccount(5)); @@ -146,10 +120,7 @@ public function testAccountCCInputOutput() : void self::assertCount(2, $this->element->getCC()); } - /** - * @covers \Modules\Tasks\Models\TaskElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testGroupCCInputOutput() : void { $this->element->addGroupCC(new NullGroup(6)); @@ -160,46 +131,31 @@ public function testGroupCCInputOutput() : void self::assertCount(2, $this->element->getCC()); } - /** - * @covers \Modules\Tasks\Models\TaskElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testInvalidAccountTo() : void { self::assertFalse($this->element->isToAccount(7)); } - /** - * @covers \Modules\Tasks\Models\TaskElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testInvalidAccountCC() : void { self::assertFalse($this->element->isCCAccount(8)); } - /** - * @covers \Modules\Tasks\Models\TaskElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testInvalidGroupTo() : void { self::assertFalse($this->element->isToGroup(9)); } - /** - * @covers \Modules\Tasks\Models\TaskElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testInvalidGroupCC() : void { self::assertFalse($this->element->isCCGroup(10)); } - /** - * @covers \Modules\Tasks\Models\TaskElement - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testSerialize() : void { $this->element->task = 2; diff --git a/tests/Models/TaskMapperTest.php b/tests/Models/TaskMapperTest.php index 34405b7..2517f70 100755 --- a/tests/Models/TaskMapperTest.php +++ b/tests/Models/TaskMapperTest.php @@ -28,21 +28,16 @@ /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Tasks\Models\TaskMapper::class)] final class TaskMapperTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Tasks\Models\TaskMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { self::assertEquals([], TaskMapper::getOpenCreatedBy(999)); } - /** - * @covers \Modules\Tasks\Models\TaskMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testCRUD() : void { $task = new Task(); @@ -141,10 +136,7 @@ public function testCRUD() : void self::assertCount(2, \end($actual)->getCC()); } - /** - * @covers \Modules\Tasks\Models\TaskMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNewest() : void { $newest = TaskMapper::getAll()->sort('id', OrderType::DESC)->limit(1)->execute(); @@ -152,11 +144,9 @@ public function testNewest() : void self::assertCount(1, $newest); } - /** - * @group volume - * @group module - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('volume')] + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testCreatedByMeForMe() : void { $text = new Text(); @@ -191,11 +181,9 @@ public function testCreatedByMeForMe() : void } } - /** - * @group volume - * @group module - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('volume')] + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testCreatedByMeForOther() : void { $text = new Text(); @@ -230,11 +218,9 @@ public function testCreatedByMeForOther() : void } } - /** - * @group volume - * @group module - * @coversNothing - */ + #[\PHPUnit\Framework\Attributes\Group('volume')] + #[\PHPUnit\Framework\Attributes\Group('module')] + #[\PHPUnit\Framework\Attributes\CoversNothing] public function testCreatedByOtherForMe() : void { $text = new Text(); diff --git a/tests/Models/TaskTest.php b/tests/Models/TaskTest.php index fad277c..8f966ee 100755 --- a/tests/Models/TaskTest.php +++ b/tests/Models/TaskTest.php @@ -25,6 +25,7 @@ /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Tasks\Models\Task::class)] final class TaskTest extends \PHPUnit\Framework\TestCase { private Task $task; @@ -37,10 +38,7 @@ protected function setUp() : void $this->task = new Task(); } - /** - * @covers \Modules\Tasks\Models\Task - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { self::assertEquals(0, $this->task->id); @@ -67,70 +65,49 @@ public function testDefault() : void self::assertInstanceOf('\Modules\Tasks\Models\NullTaskElement', $this->task->getTaskElement(1)); } - /** - * @covers \Modules\Tasks\Models\Task - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testCreatedByInputOutput() : void { $this->task->setCreatedBy(new NullAccount(1)); self::assertEquals(1, $this->task->getCreatedBy()->id); } - /** - * @covers \Modules\Tasks\Models\Task - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testStartInputOutput() : void { $this->task->start = ($date = new \DateTime('2005-05-05')); self::assertEquals($date->format('Y-m-d'), $this->task->start->format('Y-m-d')); } - /** - * @covers \Modules\Tasks\Models\Task - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testTitleInputOutput() : void { $this->task->title = 'Title'; self::assertEquals('Title', $this->task->title); } - /** - * @covers \Modules\Tasks\Models\Task - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDoneInputOutput() : void { $this->task->done = ($date = new \DateTime('2000-05-06')); self::assertEquals($date->format('Y-m-d'), $this->task->done->format('Y-m-d')); } - /** - * @covers \Modules\Tasks\Models\Task - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDueInputOutput() : void { $this->task->due = ($date = new \DateTime('2000-05-07')); self::assertEquals($date->format('Y-m-d'), $this->task->due->format('Y-m-d')); } - /** - * @covers \Modules\Tasks\Models\Task - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testClosableInputOutput() : void { $this->task->isClosable = false; self::assertFalse($this->task->isClosable); } - /** - * @covers \Modules\Tasks\Models\Task - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testElementInputOutput() : void { $taskElement1 = new TaskElement(); @@ -163,10 +140,7 @@ public function testElementInputOutput() : void self::assertEquals(0, $this->task->getTaskElement(0)->id); } - /** - * @covers \Modules\Tasks\Models\Task - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testElementRemoval() : void { $taskElement1 = new TaskElement(); @@ -189,10 +163,7 @@ public function testElementRemoval() : void self::assertTrue($success); } - /** - * @covers \Modules\Tasks\Models\Task - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testInvertElements() : void { $taskElement1 = new TaskElement(); @@ -213,50 +184,35 @@ public function testInvertElements() : void self::assertEquals([$taskElement2, $taskElement1], $this->task->invertTaskElements()); } - /** - * @covers \Modules\Tasks\Models\Task - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testInvalidElementRemoval() : void { $success = $this->task->removeElement(99); self::assertFalse($success); } - /** - * @covers \Modules\Tasks\Models\Task - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDescriptionInputOutput() : void { $this->task->description = 'Description'; self::assertEquals('Description', $this->task->description); } - /** - * @covers \Modules\Tasks\Models\Task - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDescriptionRawInputOutput() : void { $this->task->descriptionRaw = 'DescriptionRaw'; self::assertEquals('DescriptionRaw', $this->task->descriptionRaw); } - /** - * @covers \Modules\Tasks\Models\Task - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testEditableInputOutput() : void { $this->task->isEditable = false; self::assertFalse($this->task->isEditable); } - /** - * @covers \Modules\Tasks\Models\Task - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testToArray() : void { $arr = [ @@ -283,10 +239,7 @@ public function testToArray() : void self::assertTrue($isSubset); } - /** - * @covers \Modules\Tasks\Models\Task - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testToJson() : void { $arr = [ diff --git a/tests/Views/TaskViewTest.php b/tests/Views/TaskViewTest.php index ff9298e..f52343b 100755 --- a/tests/Views/TaskViewTest.php +++ b/tests/Views/TaskViewTest.php @@ -24,12 +24,10 @@ /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\Tasks\Views\TaskView::class)] class TaskViewTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\Tasks\Views\TaskView - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { $view = new TaskView(); @@ -37,10 +35,7 @@ public function testDefault() : void self::assertStringContainsString('', $view->getAccountImage(999)); } - /** - * @covers \Modules\Tasks\Views\TaskView - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testAccountImageUrl() : void { $media = new Media(); 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* + +