From ef45287d4392343fed77bb36cbbe9fca11c4bb08 Mon Sep 17 00:00:00 2001 From: Ante Prkacin Date: Mon, 27 Oct 2025 14:26:38 +0100 Subject: [PATCH 1/7] NGSTACK-1002 upgrade dependencies in 'composer.json' file --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index b98f8ad..e79313a 100644 --- a/composer.json +++ b/composer.json @@ -10,12 +10,12 @@ } ], "require": { - "php": ">=8.1", - "ibexa/core": "^4.5" + "php": ">=8.3", + "ibexa/core": "^5.0" }, "require-dev": { - "phpunit/phpunit": "^10", - "matthiasnoback/symfony-dependency-injection-test": "^4.1" + "phpunit/phpunit": "^12", + "matthiasnoback/symfony-dependency-injection-test": "^6.0" }, "minimum-stability": "dev", "prefer-stable": true, From 572d2c78084e0c0d7f9d98aee7b84d92a6fbb956 Mon Sep 17 00:00:00 2001 From: Ante Prkacin Date: Mon, 27 Oct 2025 14:27:43 +0100 Subject: [PATCH 2/7] NGSTACK-1002 replace 'ezdate' with 'ibexa_date' and 'ezdatetime' with 'ibexa_datetime' field type identifiers --- bundle/Core/ScheduledVisibilityService.php | 4 ++-- tests/bundle/Integration/BaseTest.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bundle/Core/ScheduledVisibilityService.php b/bundle/Core/ScheduledVisibilityService.php index de30c2a..226f6c6 100644 --- a/bundle/Core/ScheduledVisibilityService.php +++ b/bundle/Core/ScheduledVisibilityService.php @@ -132,8 +132,8 @@ private function isValid(Content $content): bool } if ( - ($publishFromField->fieldTypeIdentifier !== 'ezdatetime' && $publishFromField->fieldTypeIdentifier !== 'ezdate') - || ($publishToField->fieldTypeIdentifier !== 'ezdatetime' && $publishToField->fieldTypeIdentifier !== 'ezdate') + ($publishFromField->fieldTypeIdentifier !== 'ibexa_datetime' && $publishFromField->fieldTypeIdentifier !== 'ibexa_date') + || ($publishToField->fieldTypeIdentifier !== 'ibexa_datetime' && $publishToField->fieldTypeIdentifier !== 'ibexa_date') ) { return false; } diff --git a/tests/bundle/Integration/BaseTest.php b/tests/bundle/Integration/BaseTest.php index 5c9b742..fd8a3dc 100644 --- a/tests/bundle/Integration/BaseTest.php +++ b/tests/bundle/Integration/BaseTest.php @@ -93,14 +93,14 @@ protected function createContentType(): ContentType $typeCreate->creatorId = $this->generateId('user', $permissionResolver->getCurrentUserReference()->getUserId()); $typeCreate->creationDate = $this->createDateTime(); - $publishFromFieldCreate = $contentTypeService->newFieldDefinitionCreateStruct('publish_from', 'ezdate'); + $publishFromFieldCreate = $contentTypeService->newFieldDefinitionCreateStruct('publish_from', 'ibexa_date'); $publishFromFieldCreate->names = [ 'eng-GB' => 'Publish from', ]; $publishFromFieldCreate->position = 1; $typeCreate->addFieldDefinition($publishFromFieldCreate); - $publishToFieldCreate = $contentTypeService->newFieldDefinitionCreateStruct('publish_to', 'ezdatetime'); + $publishToFieldCreate = $contentTypeService->newFieldDefinitionCreateStruct('publish_to', 'ibexa_datetime'); $publishToFieldCreate->names = [ 'eng-GB' => 'Publish to', ]; From 092c0734dcb7113f43127fe14594473e60a24b6c Mon Sep 17 00:00:00 2001 From: Ante Prkacin Date: Mon, 27 Oct 2025 14:30:59 +0100 Subject: [PATCH 3/7] NGSTACK-1002 replace 'dataProvider' annotation with 'dataProvider' PHP attribute in tests --- .../NetgenIbexaScheduledVisibilityTest.php | 25 ++++++------------- .../Integration/ContentAndLocationTest.php | 5 ++-- tests/bundle/Integration/ContentTest.php | 5 ++-- tests/bundle/Integration/LocationTest.php | 5 ++-- tests/bundle/Integration/ObjectStateTest.php | 5 ++-- tests/bundle/Integration/SectionTest.php | 5 ++-- 6 files changed, 17 insertions(+), 33 deletions(-) diff --git a/tests/bundle/DependencyInjection/NetgenIbexaScheduledVisibilityTest.php b/tests/bundle/DependencyInjection/NetgenIbexaScheduledVisibilityTest.php index c7478cb..f082d88 100644 --- a/tests/bundle/DependencyInjection/NetgenIbexaScheduledVisibilityTest.php +++ b/tests/bundle/DependencyInjection/NetgenIbexaScheduledVisibilityTest.php @@ -6,6 +6,7 @@ use Matthias\SymfonyDependencyInjectionTest\PhpUnit\AbstractExtensionTestCase; use Netgen\Bundle\IbexaScheduledVisibilityBundle\DependencyInjection\NetgenIbexaScheduledVisibilityExtension; +use PHPUnit\Framework\Attributes\DataProvider; final class NetgenIbexaScheduledVisibilityTest extends AbstractExtensionTestCase { @@ -277,9 +278,7 @@ public static function provideContentTypesConfigurationCases(): iterable ]; } - /** - * @dataProvider provideDefaultConfigurationCases - */ + #[DataProvider('provideDefaultConfigurationCases')] public function testDefaultConfiguration(array $configuration): void { $this->load($configuration); @@ -322,9 +321,7 @@ public function testDefaultConfiguration(array $configuration): void ); } - /** - * @dataProvider provideEnabledConfigurationCases - */ + #[DataProvider('provideEnabledConfigurationCases')] public function testEnabledConfiguration(array $configuration, bool $expectedParameterValue): void { $this->load($configuration); @@ -335,9 +332,7 @@ public function testEnabledConfiguration(array $configuration, bool $expectedPar ); } - /** - * @dataProvider provideHandlerConfigurationCases - */ + #[DataProvider('provideHandlerConfigurationCases')] public function testHandlerConfiguration(array $configuration, string $expectedParameterValue): void { $this->load($configuration); @@ -348,9 +343,7 @@ public function testHandlerConfiguration(array $configuration, string $expectedP ); } - /** - * @dataProvider provideSectionConfigurationCases - */ + #[DataProvider('provideSectionConfigurationCases')] public function testSectionConfiguration(array $configuration, array $expectedParameterValues): void { $this->load($configuration); @@ -365,9 +358,7 @@ public function testSectionConfiguration(array $configuration, array $expectedPa ); } - /** - * @dataProvider provideObjectStateConfigurationCases - */ + #[DataProvider('provideObjectStateConfigurationCases')] public function testObjectStateConfiguration(array $configuration, array $expectedParameterValues): void { $this->load($configuration); @@ -386,9 +377,7 @@ public function testObjectStateConfiguration(array $configuration, array $expect ); } - /** - * @dataProvider provideContentTypesConfigurationCases - */ + #[DataProvider('provideContentTypesConfigurationCases')] public function testContentTypesConfiguration(array $configuration, array $expectedParameterValues): void { $this->load($configuration); diff --git a/tests/bundle/Integration/ContentAndLocationTest.php b/tests/bundle/Integration/ContentAndLocationTest.php index b47ee34..437e6b4 100644 --- a/tests/bundle/Integration/ContentAndLocationTest.php +++ b/tests/bundle/Integration/ContentAndLocationTest.php @@ -7,12 +7,11 @@ use Netgen\Bundle\IbexaScheduledVisibilityBundle\Core\VisibilityHandler\Content; use Netgen\Bundle\IbexaScheduledVisibilityBundle\Core\VisibilityHandler\ContentAndLocation; use Netgen\Bundle\IbexaScheduledVisibilityBundle\Core\VisibilityHandler\Location; +use PHPUnit\Framework\Attributes\DataProvider; final class ContentAndLocationTest extends BaseTest { - /** - * @dataProvider provideCases - */ + #[DataProvider('provideCases')] public function testUpdateVisibility(array $configuration, bool $expectedHidden) { $scheduledVisibilityService = $this->getScheduledVisibilityService(); diff --git a/tests/bundle/Integration/ContentTest.php b/tests/bundle/Integration/ContentTest.php index 81fe460..12d44a8 100644 --- a/tests/bundle/Integration/ContentTest.php +++ b/tests/bundle/Integration/ContentTest.php @@ -5,12 +5,11 @@ namespace Netgen\IbexaScheduledVisibility\Tests\Integration; use Netgen\Bundle\IbexaScheduledVisibilityBundle\Core\VisibilityHandler\Content; +use PHPUnit\Framework\Attributes\DataProvider; final class ContentTest extends BaseTest { - /** - * @dataProvider provideCases - */ + #[DataProvider('provideCases')] public function testUpdateVisibility(array $configuration, bool $expectedHidden) { $scheduledVisibilityService = $this->getScheduledVisibilityService(); diff --git a/tests/bundle/Integration/LocationTest.php b/tests/bundle/Integration/LocationTest.php index 37a86fe..22ef385 100644 --- a/tests/bundle/Integration/LocationTest.php +++ b/tests/bundle/Integration/LocationTest.php @@ -5,12 +5,11 @@ namespace Netgen\IbexaScheduledVisibility\Tests\Integration; use Netgen\Bundle\IbexaScheduledVisibilityBundle\Core\VisibilityHandler\Location; +use PHPUnit\Framework\Attributes\DataProvider; final class LocationTest extends BaseTest { - /** - * @dataProvider provideCases - */ + #[DataProvider('provideCases')] public function testUpdateVisibility(array $configuration, bool $expectedHidden) { $scheduledVisibilityService = $this->getScheduledVisibilityService(); diff --git a/tests/bundle/Integration/ObjectStateTest.php b/tests/bundle/Integration/ObjectStateTest.php index de3b298..c653905 100644 --- a/tests/bundle/Integration/ObjectStateTest.php +++ b/tests/bundle/Integration/ObjectStateTest.php @@ -6,12 +6,11 @@ use Ibexa\Contracts\Core\Repository\Values\ObjectState\ObjectState as ObjectStateValue; use Netgen\Bundle\IbexaScheduledVisibilityBundle\Core\VisibilityHandler\ObjectState; +use PHPUnit\Framework\Attributes\DataProvider; final class ObjectStateTest extends BaseTest { - /** - * @dataProvider provideCases - */ + #[DataProvider('provideCases')] public function testUpdateVisibility(array $configuration, bool $expectedHidden) { $scheduledVisibilityService = $this->getScheduledVisibilityService(); diff --git a/tests/bundle/Integration/SectionTest.php b/tests/bundle/Integration/SectionTest.php index a325c58..9fb8427 100644 --- a/tests/bundle/Integration/SectionTest.php +++ b/tests/bundle/Integration/SectionTest.php @@ -6,12 +6,11 @@ use Ibexa\Contracts\Core\Repository\Values\Content\Section as SectionValue; use Netgen\Bundle\IbexaScheduledVisibilityBundle\Core\VisibilityHandler\Section; +use PHPUnit\Framework\Attributes\DataProvider; final class SectionTest extends BaseTest { - /** - * @dataProvider provideCases - */ + #[DataProvider('provideCases')] public function testUpdateVisibility(array $configuration, bool $expectedHidden) { $scheduledVisibilityService = $this->getScheduledVisibilityService(); From 13a663645e5511d3d9442cad0db43e501ce1ccad Mon Sep 17 00:00:00 2001 From: Ante Prkacin Date: Mon, 27 Oct 2025 14:32:05 +0100 Subject: [PATCH 4/7] NGSTACK-1002 fix FQCN of APIBaseTest class in 'BaseTest.php' file --- tests/bundle/Integration/BaseTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/bundle/Integration/BaseTest.php b/tests/bundle/Integration/BaseTest.php index fd8a3dc..d14644b 100644 --- a/tests/bundle/Integration/BaseTest.php +++ b/tests/bundle/Integration/BaseTest.php @@ -7,7 +7,7 @@ use DateTime; use Ibexa\Contracts\Core\Repository\Values\Content\Content; use Ibexa\Contracts\Core\Repository\Values\ContentType\ContentType; -use Ibexa\Tests\Integration\Core\Repository\BaseTest as APIBaseTest; +use Ibexa\Tests\Integration\Core\Repository\BaseTestCase as APIBaseTest; use Netgen\Bundle\IbexaScheduledVisibilityBundle\Core\ScheduledVisibilityService; abstract class BaseTest extends APIBaseTest From f11f68a70751f650af4c5cf6875abd2c59e1b2ed Mon Sep 17 00:00:00 2001 From: Ante Prkacin Date: Mon, 27 Oct 2025 14:33:03 +0100 Subject: [PATCH 5/7] NGSTACK-1002 add DateTimeZone to DateTimes in 'BaseTest.php' file in order to work correctly --- tests/bundle/Integration/BaseTest.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/bundle/Integration/BaseTest.php b/tests/bundle/Integration/BaseTest.php index d14644b..7f32c26 100644 --- a/tests/bundle/Integration/BaseTest.php +++ b/tests/bundle/Integration/BaseTest.php @@ -25,42 +25,42 @@ public static function provideCases(): iterable [ [ 'publish_from' => null, - 'publish_to' => new DateTime('tomorrow'), + 'publish_to' => new DateTime('tomorrow', new \DateTimeZone('UTC')), ], false, ], [ [ 'publish_from' => null, - 'publish_to' => new DateTime('yesterday'), + 'publish_to' => new DateTime('yesterday', new \DateTimeZone('UTC')), ], true, ], [ [ - 'publish_from' => new DateTime('2 days ago'), - 'publish_to' => new DateTime('yesterday'), + 'publish_from' => new DateTime('2 days ago', new \DateTimeZone('UTC')), + 'publish_to' => new DateTime('yesterday', new \DateTimeZone('UTC')), ], true, ], [ [ - 'publish_from' => new DateTime('yesterday'), - 'publish_to' => new DateTime('tomorrow'), + 'publish_from' => new DateTime('yesterday', new \DateTimeZone('UTC')), + 'publish_to' => new DateTime('tomorrow', new \DateTimeZone('UTC')), ], false, ], [ [ - 'publish_from' => new DateTime('tomorrow'), + 'publish_from' => new DateTime('tomorrow', new \DateTimeZone('UTC')), 'publish_to' => null, ], true, ], [ [ - 'publish_from' => new DateTime('tomorrow'), - 'publish_to' => new DateTime('2 day'), + 'publish_from' => new DateTime('tomorrow', new \DateTimeZone('UTC')), + 'publish_to' => new DateTime('2 day', new \DateTimeZone('UTC')), ], true, ], From ed3f6e39ca26511573f59cdf37241d8a23026088 Mon Sep 17 00:00:00 2001 From: Ante Prkacin Date: Mon, 27 Oct 2025 14:33:33 +0100 Subject: [PATCH 6/7] NGSTACK-1002 add '.phpunit.cache' folder to .gitignore file --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a7419cc..919d94b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ composer.lock .phpunit.result.cache .php-cs-fixer.cache var +.phpunit.cache From 4da8364f26b736836be624d05287d3913f7cca77 Mon Sep 17 00:00:00 2001 From: Ante Prkacin Date: Mon, 27 Oct 2025 14:35:33 +0100 Subject: [PATCH 7/7] NGSTACK-1002 bump PHP version to 8.3 in 'tests' workflow --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index bbf17a4..5b8b409 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - php: ['8.1'] + php: ['8.3'] phpunit: ['phpunit.xml', 'phpunit-integration-legacy.xml'] steps: