From 8c6a5540b14fa5d2edddfe77d271d98261e75804 Mon Sep 17 00:00:00 2001 From: Sander Muller Date: Mon, 12 Oct 2026 11:09:41 +0200 Subject: [PATCH] Override the date type in EntityColumnRuleTest for every data set entity-manager.php overrides the Doctrine date type for the whole process. The data sets without an object manager expect that override, but they only get it when a test that loads entity-manager.php ran before them. With the random test order, testRuleWithAllowedNullableProperty reported an extra error for MyBrokenEntity::$six when its data set #1 ran before data set #0. Co-Authored-By: Claude Opus 5.5 (1M context) --- tests/Rules/Doctrine/ORM/EntityColumnRuleTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/Rules/Doctrine/ORM/EntityColumnRuleTest.php b/tests/Rules/Doctrine/ORM/EntityColumnRuleTest.php index a29a1d57..45fb81cd 100644 --- a/tests/Rules/Doctrine/ORM/EntityColumnRuleTest.php +++ b/tests/Rules/Doctrine/ORM/EntityColumnRuleTest.php @@ -83,6 +83,9 @@ protected function getRule(): Rule if (!Type::hasType('array')) { Type::addType('array', \Doctrine\DBAL\Types\ArrayType::class); } + // entity-manager.php overrides the date type for the whole process, so without this the + // result of a data set without an object manager depends on the tests that ran before it + Type::overrideType('date', \Doctrine\DBAL\Types\DateTimeImmutableType::class); return new EntityColumnRule( new ObjectMetadataResolver($this->objectManagerLoader, __DIR__ . '/../../../../tmp'),