diff --git a/CHANGELOG.md b/CHANGELOG.md index 0748797..93d9340 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ Latest ------ ## Changes +* [#166](https://github.com/cleverage/ui-process-bundle/issues/166) Doctrine ORM 2: the entities have readonly properties (since v3.2), which the legacy proxies of ORM 2 cannot handle (`Cannot unset readonly property ... from scope Proxies\__CG__\...` when an entity proxy is loaded). The container compilation now fails with an explicit message when ORM 2 is used without `doctrine.orm.enable_lazy_ghost_objects: true` (new internal `CheckDoctrineLazyGhostObjectsPass`); nothing changes with ORM 3. Update documentation, add tests. * [#164](https://github.com/cleverage/ui-process-bundle/issues/164) Require `symfony/polyfill-php83`, `symfony/polyfill-php84` and `symfony/polyfill-php85`: the functions of PHP 8.3 to 8.5 (`json_validate()`, `array_find()`, `array_first()`...) can be used while supporting PHP 8.2 (see `CONTRIBUTING.md`). Rector is configured for PHP 8.2 (was 8.5, which allowed it to introduce PHP 8.3+ functions without polyfill) with the `PHP_POLYFILLS` set (`withPhpSets()` without argument), it does not change the code. `array_last()` replaces `end()` in a test. Tests: lazy ghost proxies with Doctrine ORM 2 (now installed by the lowest dependencies job), as configured by the Symfony recipe: the legacy proxies cannot unset the readonly properties of the entities. * [#158](https://github.com/cleverage/ui-process-bundle/issues/158) CI: test the lowest versions allowed by `composer.json` (`--prefer-lowest`, PHP 8.2). Require `symfony/scheduler` ^6.4.44 || ^7.4.17 || ^8.1.5: the `every` expressions validation (`EveryExpressionValidator`) relies on the `PeriodicalTrigger` rejecting the intervals that do not move the run date forward or resolve to zero seconds (older versions loop forever on e.g. "yesterday", and fail with a `TypeError` on an invalid expression). `ProcessExecutionDurationFilter`: the number of seconds is cast to an integer and inlined in the DQL instead of being bound as a parameter (#111): with DBAL 3, the SQLite platform puts the `SECOND` intervals inside a string literal, so the parameter was never bound ("column index out of range" error on SQLite with DBAL 3). * [#156](https://github.com/cleverage/ui-process-bundle/issues/156) `LogRecord::contextIsEmpty()` (deprecated since v3.1, use `hasContextInfo()`) triggers a deprecation at runtime with `trigger_deprecation()` (`symfony/deprecation-contracts`, now required). Add tests. diff --git a/docs/index.md b/docs/index.md index 6f19ab6..7ea8a9d 100644 --- a/docs/index.md +++ b/docs/index.md @@ -97,6 +97,17 @@ doctrine: naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware ``` +With Doctrine ORM 2, the lazy ghost objects must be enabled (also set by the Symfony recipe of the DoctrineBundle): the +entities of the bundle have readonly properties, which the legacy proxies of ORM 2 cannot handle. Without it, the +container compilation fails with an explicit message. Doctrine ORM 3 always uses lazy ghost (or native lazy) objects. + +```yaml +# config/packages/doctrine.yaml, with Doctrine ORM 2 only +doctrine: + orm: + enable_lazy_ghost_objects: true +``` + The bundle registers its own Doctrine migrations (`CleverAge\UiProcessBundle\Migrations`). Run them, then create a first user: diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index eb9b1e3..0db3ac4 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -34,6 +34,13 @@ be marked as failed. See [not responding executions](reference/04-process_executions_and_logs.md#not-responding-executions). +## Cannot unset readonly property ... from scope Proxies\__CG__\... + +The entities of the bundle have readonly properties, not supported by the legacy proxies of Doctrine ORM 2. With +ORM 2, enable the lazy ghost objects (`doctrine.orm.enable_lazy_ghost_objects: true`, see +[database](index.md#database)) or upgrade to Doctrine ORM 3. Since the bundle checks this setting when the container +is compiled, this error is replaced by an explicit message. + ## PHP Fatal error: Allowed memory size of xxx bytes exhausted When the `store_in_database` option is enabled with a low `database_level`, the process may generate many diff --git a/src/CleverAgeUiProcessBundle.php b/src/CleverAgeUiProcessBundle.php index c2035d2..ebe3bd1 100644 --- a/src/CleverAgeUiProcessBundle.php +++ b/src/CleverAgeUiProcessBundle.php @@ -13,6 +13,8 @@ namespace CleverAge\UiProcessBundle; +use CleverAge\UiProcessBundle\DependencyInjection\Compiler\CheckDoctrineLazyGhostObjectsPass; +use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\HttpKernel\Bundle\Bundle; class CleverAgeUiProcessBundle extends Bundle @@ -22,4 +24,12 @@ public function getPath(): string { return \dirname(__DIR__); } + + #[\Override] + public function build(ContainerBuilder $container): void + { + parent::build($container); + + $container->addCompilerPass(new CheckDoctrineLazyGhostObjectsPass()); + } } diff --git a/src/DependencyInjection/Compiler/CheckDoctrineLazyGhostObjectsPass.php b/src/DependencyInjection/Compiler/CheckDoctrineLazyGhostObjectsPass.php new file mode 100644 index 0000000..1661bed --- /dev/null +++ b/src/DependencyInjection/Compiler/CheckDoctrineLazyGhostObjectsPass.php @@ -0,0 +1,54 @@ +legacyProxies ?? method_exists(ProxyFactory::class, 'resetUninitializedProxy')) + || !$container->hasParameter('doctrine.orm.enable_lazy_ghost_objects') + ) { + return; + } + + if (!$container->getParameter('doctrine.orm.enable_lazy_ghost_objects')) { + throw new LogicException(self::MESSAGE); + } + } +} diff --git a/tests/App/TestKernel.php b/tests/App/TestKernel.php index 6e5b14c..a3a174b 100644 --- a/tests/App/TestKernel.php +++ b/tests/App/TestKernel.php @@ -72,7 +72,8 @@ protected function configureContainer(\Symfony\Component\DependencyInjection\Loa { $container->import(__DIR__.'/config/packages.yaml'); // Doctrine ORM 2 (lowest dependencies): lazy ghost proxies, as configured by the Symfony recipe, the legacy - // proxies cannot unset the readonly properties of the entities (ProcessExecution::$code...) + // proxies cannot unset the readonly properties of the entities (ProcessExecution::$code...), see + // CheckDoctrineLazyGhostObjectsPass if (method_exists(ProxyFactory::class, 'resetUninitializedProxy')) { $container->extension('doctrine', ['orm' => ['enable_lazy_ghost_objects' => true]]); } diff --git a/tests/CleverAgeUiProcessBundleTest.php b/tests/CleverAgeUiProcessBundleTest.php index 7d19bd1..1def66f 100644 --- a/tests/CleverAgeUiProcessBundleTest.php +++ b/tests/CleverAgeUiProcessBundleTest.php @@ -15,12 +15,15 @@ use CleverAge\UiProcessBundle\CleverAgeUiProcessBundle; use CleverAge\UiProcessBundle\DependencyInjection\CleverAgeUiProcessExtension; +use CleverAge\UiProcessBundle\DependencyInjection\Compiler\CheckDoctrineLazyGhostObjectsPass; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\UsesClass; use PHPUnit\Framework\TestCase; +use Symfony\Component\DependencyInjection\ContainerBuilder; #[CoversClass(CleverAgeUiProcessBundle::class)] #[UsesClass(CleverAgeUiProcessExtension::class)] +#[UsesClass(CheckDoctrineLazyGhostObjectsPass::class)] class CleverAgeUiProcessBundleTest extends TestCase { public function testPathIsTheBundleRootDirectory(): void @@ -39,4 +42,16 @@ public function testContainerExtension(): void self::assertInstanceOf(CleverAgeUiProcessExtension::class, $extension); self::assertSame('clever_age_ui_process', $extension->getAlias()); } + + public function testDoctrineLazyGhostObjectsCheckIsRegistered(): void + { + $container = new ContainerBuilder(); + (new CleverAgeUiProcessBundle())->build($container); + + $passes = array_filter( + $container->getCompilerPassConfig()->getPasses(), + static fn (object $pass): bool => $pass instanceof CheckDoctrineLazyGhostObjectsPass, + ); + self::assertCount(1, $passes); + } } diff --git a/tests/DependencyInjection/Compiler/CheckDoctrineLazyGhostObjectsPassTest.php b/tests/DependencyInjection/Compiler/CheckDoctrineLazyGhostObjectsPassTest.php new file mode 100644 index 0000000..509a5f2 --- /dev/null +++ b/tests/DependencyInjection/Compiler/CheckDoctrineLazyGhostObjectsPassTest.php @@ -0,0 +1,76 @@ +setParameter('doctrine.orm.enable_lazy_ghost_objects', false); + + $this->expectException(LogicException::class); + $this->expectExceptionMessage(CheckDoctrineLazyGhostObjectsPass::MESSAGE); + + (new CheckDoctrineLazyGhostObjectsPass(legacyProxies: true))->process($container); + } + + /** + * @return iterable + */ + public static function provideValidConfigurations(): iterable + { + yield 'ORM 2 with lazy ghost objects' => [true, true]; + yield 'ORM 2 without the DoctrineBundle parameter' => [true, null]; + yield 'ORM 3' => [false, false]; + yield 'ORM 3 without the DoctrineBundle parameter' => [false, null]; + } + + #[DataProvider('provideValidConfigurations')] + #[DoesNotPerformAssertions] + public function testValidConfigurations(bool $legacyProxies, ?bool $lazyGhostObjects): void + { + $container = new ContainerBuilder(); + if (null !== $lazyGhostObjects) { + $container->setParameter('doctrine.orm.enable_lazy_ghost_objects', $lazyGhostObjects); + } + + (new CheckDoctrineLazyGhostObjectsPass($legacyProxies))->process($container); + } + + public function testInstalledOrmIsDetectedByDefault(): void + { + $container = new ContainerBuilder(); + $container->setParameter('doctrine.orm.enable_lazy_ghost_objects', false); + + // ORM 3 (no legacy proxy): nothing to check; ORM 2 (lowest dependencies): the check fails + if (method_exists(ProxyFactory::class, 'resetUninitializedProxy')) { + $this->expectException(LogicException::class); + } else { + $this->addToAssertionCount(1); + } + + (new CheckDoctrineLazyGhostObjectsPass())->process($container); + } +} diff --git a/tests/Functional/HttpProcessExecuteTest.php b/tests/Functional/HttpProcessExecuteTest.php index 60bd2fa..f6265d7 100644 --- a/tests/Functional/HttpProcessExecuteTest.php +++ b/tests/Functional/HttpProcessExecuteTest.php @@ -21,6 +21,7 @@ use CleverAge\UiProcessBundle\Controller\Admin\UserCrudController; use CleverAge\UiProcessBundle\Controller\ProcessExecuteController; use CleverAge\UiProcessBundle\DependencyInjection\CleverAgeUiProcessExtension; +use CleverAge\UiProcessBundle\DependencyInjection\Compiler\CheckDoctrineLazyGhostObjectsPass; use CleverAge\UiProcessBundle\DependencyInjection\Configuration; use CleverAge\UiProcessBundle\Entity\ProcessExecution; use CleverAge\UiProcessBundle\Entity\User; @@ -54,6 +55,7 @@ #[CoversClass(ProcessExecuteController::class)] #[CoversClass(HttpProcessExecutionAuthenticator::class)] #[UsesClass(CleverAgeUiProcessBundle::class)] +#[UsesClass(CheckDoctrineLazyGhostObjectsPass::class)] #[UsesClass(LogRecordCrudController::class)] #[UsesClass(ProcessDashboardController::class)] #[UsesClass(ProcessExecutionCrudController::class)] diff --git a/tests/Functional/LaunchActionTest.php b/tests/Functional/LaunchActionTest.php index be21465..749eb26 100644 --- a/tests/Functional/LaunchActionTest.php +++ b/tests/Functional/LaunchActionTest.php @@ -22,6 +22,7 @@ use CleverAge\UiProcessBundle\Controller\Admin\ProcessScheduleCrudController; use CleverAge\UiProcessBundle\Controller\Admin\UserCrudController; use CleverAge\UiProcessBundle\DependencyInjection\CleverAgeUiProcessExtension; +use CleverAge\UiProcessBundle\DependencyInjection\Compiler\CheckDoctrineLazyGhostObjectsPass; use CleverAge\UiProcessBundle\DependencyInjection\Configuration; use CleverAge\UiProcessBundle\Entity\User; use CleverAge\UiProcessBundle\EventSubscriber\ProcessEventSubscriber; @@ -60,6 +61,7 @@ #[UsesClass(ProcessExecutionExtensionRuntime::class)] #[UsesClass(ProcessExtensionRuntime::class)] #[UsesClass(CleverAgeUiProcessBundle::class)] +#[UsesClass(CheckDoctrineLazyGhostObjectsPass::class)] #[UsesClass(LogRecordCrudController::class)] #[UsesClass(ProcessExecutionCrudController::class)] #[UsesClass(ProcessScheduleCrudController::class)] diff --git a/tests/Functional/LogRecordCrudTest.php b/tests/Functional/LogRecordCrudTest.php index 2787794..7a84093 100644 --- a/tests/Functional/LogRecordCrudTest.php +++ b/tests/Functional/LogRecordCrudTest.php @@ -23,6 +23,7 @@ use CleverAge\UiProcessBundle\Controller\Admin\ProcessScheduleCrudController; use CleverAge\UiProcessBundle\Controller\Admin\UserCrudController; use CleverAge\UiProcessBundle\DependencyInjection\CleverAgeUiProcessExtension; +use CleverAge\UiProcessBundle\DependencyInjection\Compiler\CheckDoctrineLazyGhostObjectsPass; use CleverAge\UiProcessBundle\DependencyInjection\Configuration; use CleverAge\UiProcessBundle\Entity\LogRecord; use CleverAge\UiProcessBundle\Entity\ProcessExecution; @@ -58,6 +59,7 @@ #[UsesClass(ProcessExtension::class)] #[UsesClass(LogLevelExtensionRuntime::class)] #[UsesClass(CleverAgeUiProcessBundle::class)] +#[UsesClass(CheckDoctrineLazyGhostObjectsPass::class)] #[UsesClass(ProcessExecutionCrudController::class)] #[UsesClass(ProcessScheduleCrudController::class)] #[UsesClass(UserCrudController::class)] diff --git a/tests/Functional/ProcessExecutionCrudTest.php b/tests/Functional/ProcessExecutionCrudTest.php index 47e12ba..2caa679 100644 --- a/tests/Functional/ProcessExecutionCrudTest.php +++ b/tests/Functional/ProcessExecutionCrudTest.php @@ -23,6 +23,7 @@ use CleverAge\UiProcessBundle\Controller\Admin\ProcessScheduleCrudController; use CleverAge\UiProcessBundle\Controller\Admin\UserCrudController; use CleverAge\UiProcessBundle\DependencyInjection\CleverAgeUiProcessExtension; +use CleverAge\UiProcessBundle\DependencyInjection\Compiler\CheckDoctrineLazyGhostObjectsPass; use CleverAge\UiProcessBundle\DependencyInjection\Configuration; use CleverAge\UiProcessBundle\Entity\Enum\ProcessExecutionStatus; use CleverAge\UiProcessBundle\Entity\LogRecord; @@ -64,6 +65,7 @@ #[UsesClass(LogLevelExtensionRuntime::class)] #[UsesClass(ProcessExecutionExtensionRuntime::class)] #[UsesClass(CleverAgeUiProcessBundle::class)] +#[UsesClass(CheckDoctrineLazyGhostObjectsPass::class)] #[UsesClass(LogRecordCrudController::class)] #[UsesClass(ProcessScheduleCrudController::class)] #[UsesClass(UserCrudController::class)] diff --git a/tests/Functional/ProcessExecutionNotificationTest.php b/tests/Functional/ProcessExecutionNotificationTest.php index 1a50d70..fdbe070 100644 --- a/tests/Functional/ProcessExecutionNotificationTest.php +++ b/tests/Functional/ProcessExecutionNotificationTest.php @@ -16,6 +16,7 @@ use CleverAge\ProcessBundle\Manager\ProcessManager; use CleverAge\UiProcessBundle\CleverAgeUiProcessBundle; use CleverAge\UiProcessBundle\DependencyInjection\CleverAgeUiProcessExtension; +use CleverAge\UiProcessBundle\DependencyInjection\Compiler\CheckDoctrineLazyGhostObjectsPass; use CleverAge\UiProcessBundle\DependencyInjection\Configuration; use CleverAge\UiProcessBundle\Entity\ProcessExecution; use CleverAge\UiProcessBundle\Event\ProcessExecutionEndedEvent; @@ -38,6 +39,7 @@ #[CoversClass(ProcessExecutionNotifier::class)] #[CoversClass(ProcessExecutionEndedEvent::class)] #[UsesClass(CleverAgeUiProcessBundle::class)] +#[UsesClass(CheckDoctrineLazyGhostObjectsPass::class)] #[UsesClass(CleverAgeUiProcessExtension::class)] #[UsesClass(Configuration::class)] #[UsesClass(ProcessExecution::class)] diff --git a/tests/Functional/ProcessListTest.php b/tests/Functional/ProcessListTest.php index 77b12ec..6dc0815 100644 --- a/tests/Functional/ProcessListTest.php +++ b/tests/Functional/ProcessListTest.php @@ -21,6 +21,7 @@ use CleverAge\UiProcessBundle\Controller\Admin\ProcessScheduleCrudController; use CleverAge\UiProcessBundle\Controller\Admin\UserCrudController; use CleverAge\UiProcessBundle\DependencyInjection\CleverAgeUiProcessExtension; +use CleverAge\UiProcessBundle\DependencyInjection\Compiler\CheckDoctrineLazyGhostObjectsPass; use CleverAge\UiProcessBundle\DependencyInjection\Configuration; use CleverAge\UiProcessBundle\Entity\User; use CleverAge\UiProcessBundle\EventSubscriber\ProcessEventSubscriber; @@ -53,6 +54,7 @@ #[UsesClass(ProcessExecutionExtensionRuntime::class)] #[UsesClass(ProcessExtensionRuntime::class)] #[UsesClass(CleverAgeUiProcessBundle::class)] +#[UsesClass(CheckDoctrineLazyGhostObjectsPass::class)] #[UsesClass(LogRecordCrudController::class)] #[UsesClass(ProcessExecutionCrudController::class)] #[UsesClass(ProcessScheduleCrudController::class)] diff --git a/tests/Functional/ProcessScheduleCrudTest.php b/tests/Functional/ProcessScheduleCrudTest.php index 52c851b..a820a89 100644 --- a/tests/Functional/ProcessScheduleCrudTest.php +++ b/tests/Functional/ProcessScheduleCrudTest.php @@ -21,6 +21,7 @@ use CleverAge\UiProcessBundle\Controller\Admin\ProcessScheduleCrudController; use CleverAge\UiProcessBundle\Controller\Admin\UserCrudController; use CleverAge\UiProcessBundle\DependencyInjection\CleverAgeUiProcessExtension; +use CleverAge\UiProcessBundle\DependencyInjection\Compiler\CheckDoctrineLazyGhostObjectsPass; use CleverAge\UiProcessBundle\DependencyInjection\Configuration; use CleverAge\UiProcessBundle\Entity\Enum\ProcessScheduleType; use CleverAge\UiProcessBundle\Entity\ProcessSchedule; @@ -61,6 +62,7 @@ #[UsesClass(EveryExpressionValidator::class)] #[UsesClass(IsValidProcessCodeValidator::class)] #[UsesClass(CleverAgeUiProcessBundle::class)] +#[UsesClass(CheckDoctrineLazyGhostObjectsPass::class)] #[UsesClass(LogRecordCrudController::class)] #[UsesClass(ProcessExecutionCrudController::class)] #[UsesClass(UserCrudController::class)] diff --git a/tests/Functional/PurgeLogsCommandTest.php b/tests/Functional/PurgeLogsCommandTest.php index ab7d1c6..a7790be 100644 --- a/tests/Functional/PurgeLogsCommandTest.php +++ b/tests/Functional/PurgeLogsCommandTest.php @@ -17,6 +17,7 @@ use CleverAge\UiProcessBundle\CleverAgeUiProcessBundle; use CleverAge\UiProcessBundle\Command\PurgeLogsCommand; use CleverAge\UiProcessBundle\DependencyInjection\CleverAgeUiProcessExtension; +use CleverAge\UiProcessBundle\DependencyInjection\Compiler\CheckDoctrineLazyGhostObjectsPass; use CleverAge\UiProcessBundle\DependencyInjection\Configuration; use CleverAge\UiProcessBundle\Entity\LogRecord; use CleverAge\UiProcessBundle\Entity\ProcessExecution; @@ -32,6 +33,7 @@ #[CoversClass(PurgeLogsCommand::class)] #[UsesClass(CleverAgeUiProcessBundle::class)] +#[UsesClass(CheckDoctrineLazyGhostObjectsPass::class)] #[UsesClass(CleverAgeUiProcessExtension::class)] #[UsesClass(Configuration::class)] #[UsesClass(LogRecord::class)] diff --git a/tests/Functional/SecurityTest.php b/tests/Functional/SecurityTest.php index 6fd0e18..e66ee06 100644 --- a/tests/Functional/SecurityTest.php +++ b/tests/Functional/SecurityTest.php @@ -28,6 +28,7 @@ use CleverAge\UiProcessBundle\Controller\Admin\Security\LogoutController; use CleverAge\UiProcessBundle\Controller\Admin\UserCrudController; use CleverAge\UiProcessBundle\DependencyInjection\CleverAgeUiProcessExtension; +use CleverAge\UiProcessBundle\DependencyInjection\Compiler\CheckDoctrineLazyGhostObjectsPass; use CleverAge\UiProcessBundle\DependencyInjection\Configuration; use CleverAge\UiProcessBundle\Entity\User; use CleverAge\UiProcessBundle\EventSubscriber\ProcessEventSubscriber; @@ -69,6 +70,7 @@ #[UsesClass(ProcessExecutionExtension::class)] #[UsesClass(ProcessExtension::class)] #[UsesClass(CleverAgeUiProcessBundle::class)] +#[UsesClass(CheckDoctrineLazyGhostObjectsPass::class)] #[UsesClass(CleverAgeUiProcessExtension::class)] #[UsesClass(Configuration::class)] #[UsesClass(ProcessEventSubscriber::class)] diff --git a/tests/Functional/UserCrudTest.php b/tests/Functional/UserCrudTest.php index 9cc230b..c7461f2 100644 --- a/tests/Functional/UserCrudTest.php +++ b/tests/Functional/UserCrudTest.php @@ -20,6 +20,7 @@ use CleverAge\UiProcessBundle\Controller\Admin\ProcessScheduleCrudController; use CleverAge\UiProcessBundle\Controller\Admin\UserCrudController; use CleverAge\UiProcessBundle\DependencyInjection\CleverAgeUiProcessExtension; +use CleverAge\UiProcessBundle\DependencyInjection\Compiler\CheckDoctrineLazyGhostObjectsPass; use CleverAge\UiProcessBundle\DependencyInjection\Configuration; use CleverAge\UiProcessBundle\Entity\User; use CleverAge\UiProcessBundle\EventSubscriber\ProcessEventSubscriber; @@ -45,6 +46,7 @@ #[UsesClass(ProcessExecutionExtension::class)] #[UsesClass(ProcessExtension::class)] #[UsesClass(CleverAgeUiProcessBundle::class)] +#[UsesClass(CheckDoctrineLazyGhostObjectsPass::class)] #[UsesClass(LogRecordCrudController::class)] #[UsesClass(ProcessExecutionCrudController::class)] #[UsesClass(ProcessScheduleCrudController::class)] diff --git a/tests/Manager/ProcessExecutionManagerEntityManagerTest.php b/tests/Manager/ProcessExecutionManagerEntityManagerTest.php index 64609be..7f1380a 100644 --- a/tests/Manager/ProcessExecutionManagerEntityManagerTest.php +++ b/tests/Manager/ProcessExecutionManagerEntityManagerTest.php @@ -15,6 +15,7 @@ use CleverAge\UiProcessBundle\CleverAgeUiProcessBundle; use CleverAge\UiProcessBundle\DependencyInjection\CleverAgeUiProcessExtension; +use CleverAge\UiProcessBundle\DependencyInjection\Compiler\CheckDoctrineLazyGhostObjectsPass; use CleverAge\UiProcessBundle\DependencyInjection\Configuration; use CleverAge\UiProcessBundle\Entity\Enum\ProcessExecutionStatus; use CleverAge\UiProcessBundle\Entity\LogRecord; @@ -41,6 +42,7 @@ #[CoversClass(ProcessExecutionRepository::class)] #[CoversClass(DoctrineProcessHandler::class)] #[UsesClass(CleverAgeUiProcessBundle::class)] +#[UsesClass(CheckDoctrineLazyGhostObjectsPass::class)] #[UsesClass(CleverAgeUiProcessExtension::class)] #[UsesClass(Configuration::class)] #[UsesClass(ProcessEventSubscriber::class)] diff --git a/tests/Monolog/Handler/DoctrineProcessHandlerEntityManagerTest.php b/tests/Monolog/Handler/DoctrineProcessHandlerEntityManagerTest.php index 12b25e2..a573755 100644 --- a/tests/Monolog/Handler/DoctrineProcessHandlerEntityManagerTest.php +++ b/tests/Monolog/Handler/DoctrineProcessHandlerEntityManagerTest.php @@ -15,6 +15,7 @@ use CleverAge\UiProcessBundle\CleverAgeUiProcessBundle; use CleverAge\UiProcessBundle\DependencyInjection\CleverAgeUiProcessExtension; +use CleverAge\UiProcessBundle\DependencyInjection\Compiler\CheckDoctrineLazyGhostObjectsPass; use CleverAge\UiProcessBundle\DependencyInjection\Configuration; use CleverAge\UiProcessBundle\Entity\Enum\ProcessExecutionStatus; use CleverAge\UiProcessBundle\Entity\LogRecord; @@ -36,6 +37,7 @@ */ #[CoversClass(DoctrineProcessHandler::class)] #[UsesClass(CleverAgeUiProcessBundle::class)] +#[UsesClass(CheckDoctrineLazyGhostObjectsPass::class)] #[UsesClass(CleverAgeUiProcessExtension::class)] #[UsesClass(Configuration::class)] #[UsesClass(ProcessEventSubscriber::class)] diff --git a/tests/Repository/ProcessExecutionRepositoryTest.php b/tests/Repository/ProcessExecutionRepositoryTest.php index 5d2c792..0f23e3f 100644 --- a/tests/Repository/ProcessExecutionRepositoryTest.php +++ b/tests/Repository/ProcessExecutionRepositoryTest.php @@ -15,6 +15,7 @@ use CleverAge\UiProcessBundle\CleverAgeUiProcessBundle; use CleverAge\UiProcessBundle\DependencyInjection\CleverAgeUiProcessExtension; +use CleverAge\UiProcessBundle\DependencyInjection\Compiler\CheckDoctrineLazyGhostObjectsPass; use CleverAge\UiProcessBundle\DependencyInjection\Configuration; use CleverAge\UiProcessBundle\Entity\LogRecord; use CleverAge\UiProcessBundle\Entity\ProcessExecution; @@ -31,6 +32,7 @@ #[CoversClass(ProcessExecutionRepository::class)] #[UsesClass(CleverAgeUiProcessBundle::class)] +#[UsesClass(CheckDoctrineLazyGhostObjectsPass::class)] #[UsesClass(CleverAgeUiProcessExtension::class)] #[UsesClass(Configuration::class)] #[UsesClass(ProcessEventSubscriber::class)] diff --git a/tests/Repository/ProcessScheduleRepositoryTest.php b/tests/Repository/ProcessScheduleRepositoryTest.php index 3ce1f99..62d41f8 100644 --- a/tests/Repository/ProcessScheduleRepositoryTest.php +++ b/tests/Repository/ProcessScheduleRepositoryTest.php @@ -15,6 +15,7 @@ use CleverAge\UiProcessBundle\CleverAgeUiProcessBundle; use CleverAge\UiProcessBundle\DependencyInjection\CleverAgeUiProcessExtension; +use CleverAge\UiProcessBundle\DependencyInjection\Compiler\CheckDoctrineLazyGhostObjectsPass; use CleverAge\UiProcessBundle\DependencyInjection\Configuration; use CleverAge\UiProcessBundle\Entity\Enum\ProcessScheduleType; use CleverAge\UiProcessBundle\Entity\ProcessSchedule; @@ -29,6 +30,7 @@ #[CoversClass(ProcessScheduleRepository::class)] #[UsesClass(CleverAgeUiProcessBundle::class)] +#[UsesClass(CheckDoctrineLazyGhostObjectsPass::class)] #[UsesClass(CleverAgeUiProcessExtension::class)] #[UsesClass(Configuration::class)] #[UsesClass(ProcessEventSubscriber::class)] diff --git a/tests/StopChecker/ProcessExecutionStopCheckerTest.php b/tests/StopChecker/ProcessExecutionStopCheckerTest.php index 2384e57..bd30a96 100644 --- a/tests/StopChecker/ProcessExecutionStopCheckerTest.php +++ b/tests/StopChecker/ProcessExecutionStopCheckerTest.php @@ -18,6 +18,7 @@ use CleverAge\ProcessBundle\Model\ProcessState; use CleverAge\UiProcessBundle\CleverAgeUiProcessBundle; use CleverAge\UiProcessBundle\DependencyInjection\CleverAgeUiProcessExtension; +use CleverAge\UiProcessBundle\DependencyInjection\Compiler\CheckDoctrineLazyGhostObjectsPass; use CleverAge\UiProcessBundle\DependencyInjection\Configuration; use CleverAge\UiProcessBundle\Entity\ProcessExecution; use CleverAge\UiProcessBundle\EventSubscriber\ProcessEventSubscriber; @@ -34,6 +35,7 @@ #[CoversClass(ProcessExecutionStopChecker::class)] #[UsesClass(CleverAgeUiProcessBundle::class)] +#[UsesClass(CheckDoctrineLazyGhostObjectsPass::class)] #[UsesClass(CleverAgeUiProcessExtension::class)] #[UsesClass(Configuration::class)] #[UsesClass(ProcessEventSubscriber::class)]