From 5e98fe136df6803aa95670a12df9ab9bbedec365 Mon Sep 17 00:00:00 2001 From: Jano Paetzold Date: Thu, 13 Aug 2026 15:26:45 +0200 Subject: [PATCH 1/2] Update AppClassTemplatesTest to the class template's current mapping configuration --- tests/Resources/AppClassTemplatesTest.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/Resources/AppClassTemplatesTest.php b/tests/Resources/AppClassTemplatesTest.php index 1730679..feac48f 100644 --- a/tests/Resources/AppClassTemplatesTest.php +++ b/tests/Resources/AppClassTemplatesTest.php @@ -49,6 +49,8 @@ protected function setUp(): void [__DIR__.'/../../Resources/app-class-templates'], isDevMode: true, ); + // our templates are opinionated in regard of using the UnderscoreNamingStrategy, and their custom mapping relies on this + $config->setNamingStrategy(new \Doctrine\ORM\Mapping\UnderscoreNamingStrategy(\CASE_LOWER, true)); $config->enableNativeLazyObjects(true); $this->em = new EntityManager($connection, $config, $eventManager); @@ -120,13 +122,12 @@ public function recipient_has_unique_constraints_on_email_and_uuid(): void } #[Test] - public function pending_opt_in_has_unique_constraints_on_email_address_hash_and_uuid(): void + public function pending_opt_in_has_unique_constraint_on_email_address_hash(): void { $tableName = $this->em->getClassMetadata(PendingOptInTemplate::class)->getTableName(); $constrainedColumns = $this->getUniqueConstraintColumns($tableName); - self::assertContains(['emailAddressHash'], $constrainedColumns); - self::assertContains(['uuid'], $constrainedColumns); + self::assertContains(['email_address_hash'], $constrainedColumns); } private function getSchema(): \Doctrine\DBAL\Schema\Schema From 541891db1d1ce51d63fbae20a75df1534468b095 Mon Sep 17 00:00:00 2001 From: Jano Paetzold Date: Thu, 13 Aug 2026 15:34:24 +0200 Subject: [PATCH 2/2] Corect gramer lel --- tests/Resources/AppClassTemplatesTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Resources/AppClassTemplatesTest.php b/tests/Resources/AppClassTemplatesTest.php index feac48f..674d641 100644 --- a/tests/Resources/AppClassTemplatesTest.php +++ b/tests/Resources/AppClassTemplatesTest.php @@ -49,7 +49,7 @@ protected function setUp(): void [__DIR__.'/../../Resources/app-class-templates'], isDevMode: true, ); - // our templates are opinionated in regard of using the UnderscoreNamingStrategy, and their custom mapping relies on this + // our templates are opinionated in favour of the UnderscoreNamingStrategy, and their custom mapping relies on this $config->setNamingStrategy(new \Doctrine\ORM\Mapping\UnderscoreNamingStrategy(\CASE_LOWER, true)); $config->enableNativeLazyObjects(true);