From 18bc3569ce11b0de493ea60e878303b4f2793bef Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 20 Mar 2024 05:15:59 +0000 Subject: [PATCH] upgrade phpunit --- tests/Models/EventMapperTest.php | 11 ++-- tests/Models/EventTest.php | 16 ++---- tests/Models/NullEventAttributeTest.php | 16 ++---- tests/Models/NullEventAttributeTypeTest.php | 16 ++---- tests/Models/NullEventAttributeValueTest.php | 16 ++---- tests/phpunit_default.xml | 56 ++++++++++---------- 6 files changed, 48 insertions(+), 83 deletions(-) diff --git a/tests/Models/EventMapperTest.php b/tests/Models/EventMapperTest.php index cd40b60..bf202aa 100755 --- a/tests/Models/EventMapperTest.php +++ b/tests/Models/EventMapperTest.php @@ -27,12 +27,10 @@ use phpOMS\Localization\Money; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\EventManagement\Models\EventMapper::class)] final class EventMapperTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\EventManagement\Models\EventMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testCRUD() : void { $event = new Event(); @@ -99,10 +97,7 @@ final class EventMapperTest extends \PHPUnit\Framework\TestCase self::assertEquals(\end($expected)->name, \end($actual)->name); } - /** - * @covers \Modules\EventManagement\Models\EventMapper - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNewest() : void { $newest = EventMapper::getAll()->sort('id', OrderType::DESC)->limit(1)->execute(); diff --git a/tests/Models/EventTest.php b/tests/Models/EventTest.php index 01a7441..c891704 100755 --- a/tests/Models/EventTest.php +++ b/tests/Models/EventTest.php @@ -22,6 +22,7 @@ use phpOMS\Stdlib\Base\FloatInt; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\EventManagement\Models\Event::class)] final class EventTest extends \PHPUnit\Framework\TestCase { private Event $event; @@ -34,10 +35,7 @@ final class EventTest extends \PHPUnit\Framework\TestCase $this->event = new Event(); } - /** - * @covers \Modules\EventManagement\Models\Event - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { self::assertEquals(0, $this->event->id); @@ -55,20 +53,14 @@ final class EventTest extends \PHPUnit\Framework\TestCase self::assertEquals(ProgressType::MANUAL, $this->event->progressType); } - /** - * @covers \Modules\EventManagement\Models\Event - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testProgressInputOutput() : void { $this->event->progress = 10; self::assertEquals(10, $this->event->progress); } - /** - * @covers \Modules\EventManagement\Models\Event - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testSerialize() : void { $this->event->name = 'Name'; diff --git a/tests/Models/NullEventAttributeTest.php b/tests/Models/NullEventAttributeTest.php index 667937e..4ee43e4 100644 --- a/tests/Models/NullEventAttributeTest.php +++ b/tests/Models/NullEventAttributeTest.php @@ -19,31 +19,23 @@ use Modules\EventManagement\Models\NullEventAttribute; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\EventManagement\Models\NullEventAttribute::class)] final class NullEventAttributeTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\EventManagement\Models\NullEventAttribute - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\EventManagement\Models\EventAttribute', new NullEventAttribute()); } - /** - * @covers \Modules\EventManagement\Models\NullEventAttribute - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullEventAttribute(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\EventManagement\Models\NullEventAttribute - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullEventAttribute(2); diff --git a/tests/Models/NullEventAttributeTypeTest.php b/tests/Models/NullEventAttributeTypeTest.php index aef1fc1..2c35106 100644 --- a/tests/Models/NullEventAttributeTypeTest.php +++ b/tests/Models/NullEventAttributeTypeTest.php @@ -19,31 +19,23 @@ use Modules\EventManagement\Models\NullEventAttributeType; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\EventManagement\Models\NullEventAttributeType::class)] final class NullEventAttributeTypeTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\EventManagement\Models\NullEventAttributeType - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\EventManagement\Models\EventAttributeType', new NullEventAttributeType()); } - /** - * @covers \Modules\EventManagement\Models\NullEventAttributeType - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullEventAttributeType(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\EventManagement\Models\NullEventAttributeType - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullEventAttributeType(2); diff --git a/tests/Models/NullEventAttributeValueTest.php b/tests/Models/NullEventAttributeValueTest.php index 67bc7f8..36fab22 100644 --- a/tests/Models/NullEventAttributeValueTest.php +++ b/tests/Models/NullEventAttributeValueTest.php @@ -19,31 +19,23 @@ use Modules\EventManagement\Models\NullEventAttributeValue; /** * @internal */ +#[\PHPUnit\Framework\Attributes\CoversClass(\Modules\EventManagement\Models\NullEventAttributeValue::class)] final class NullEventAttributeValueTest extends \PHPUnit\Framework\TestCase { - /** - * @covers \Modules\EventManagement\Models\NullEventAttributeValue - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testNull() : void { self::assertInstanceOf('\Modules\EventManagement\Models\EventAttributeValue', new NullEventAttributeValue()); } - /** - * @covers \Modules\EventManagement\Models\NullEventAttributeValue - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testId() : void { $null = new NullEventAttributeValue(2); self::assertEquals(2, $null->id); } - /** - * @covers \Modules\EventManagement\Models\NullEventAttributeValue - * @group module - */ + #[\PHPUnit\Framework\Attributes\Group('module')] public function testJsonSerialize() : void { $null = new NullEventAttributeValue(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* + +