Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions tests/Resources/AppClassTemplatesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ protected function setUp(): void
[__DIR__.'/../../Resources/app-class-templates'],
isDevMode: true,
);
// 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);

$this->em = new EntityManager($connection, $config, $eventManager);
Expand Down Expand Up @@ -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
Expand Down
Loading