Skip to content

Conversation

greg0ire
Copy link
Member

No description provided.

greg0ire and others added 6 commits September 12, 2025 09:17
PHPUnit 11 is not a fan of that:

	1) Doctrine\Bundle\DoctrineBundle\Tests\DependencyInjection\Compiler\CacheCompatibilityPassTest::testCacheConfigUsingServiceDefinedByApplication
	Error: Typed property MockObject_Region_05946efc::$__phpunit_state must not be accessed before initialization

	/home/greg/dev/DoctrineBundle/vendor/doctrine/orm/src/Cache/DefaultCacheFactory.php:58
	/tmp/sf_kernel_ba1be5d8f77bfc90137d39c20fb6e3be/var/cache/test/Container7B0Xppy/getDoctrine_Orm_DefaultConfigurationService.php:37
	/tmp/sf_kernel_ba1be5d8f77bfc90137d39c20fb6e3be/var/cache/test/Container7B0Xppy/Doctrine_Bundle_DoctrineBundle_Tests_DependencyInjection_Fixtures_TestKernel_zxZtpVTestContainer.php:93
	/tmp/sf_kernel_ba1be5d8f77bfc90137d39c20fb6e3be/var/cache/test/Container7B0Xppy/getDoctrine_Orm_DefaultEntityManagerService.php:25
	/tmp/sf_kernel_ba1be5d8f77bfc90137d39c20fb6e3be/var/cache/test/Container7B0Xppy/getDoctrine_Orm_DefaultEntityManagerService.php:22
	/home/greg/dev/DoctrineBundle/vendor/doctrine/orm/src/EntityManager.php:162
	/home/greg/dev/DoctrineBundle/src/CacheWarmer/DoctrineMetadataCacheWarmer.php:37
	/home/greg/dev/DoctrineBundle/vendor/symfony/framework-bundle/CacheWarmer/AbstractPhpFileCacheWarmer.php:41
	/home/greg/dev/DoctrineBundle/vendor/symfony/http-kernel/CacheWarmer/CacheWarmerAggregate.php:96
	/home/greg/dev/DoctrineBundle/vendor/symfony/http-kernel/Kernel.php:520
	/home/greg/dev/DoctrineBundle/vendor/symfony/http-kernel/Kernel.php:718
	/home/greg/dev/DoctrineBundle/vendor/symfony/http-kernel/Kernel.php:120
	/home/greg/dev/DoctrineBundle/tests/DependencyInjection/Compiler/CacheCompatibilityPassTest.php:80

Anyway, do not mock what you do not own ™️
PHPUnit 11 warns about tests that involvke Symfony kernels:

> Test code or tested code did not remove its own exception handlers

See symfony/symfony#53812
@greg0ire greg0ire merged commit d56880f into doctrine:3.0.x Sep 12, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant