1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
<?php
declare(strict_types=1);
namespace Doctrine\Tests\ORM\Mapping;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Schema\Name\UnquotedIdentifierFolding;
use Doctrine\ORM\Mapping\DefaultQuoteStrategy;
use Doctrine\Tests\Models\NonPublicSchemaJoins\User as NonPublicSchemaUser;
use Doctrine\Tests\OrmTestCase;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\RequiresPhpunit;
use function assert;
use function enum_exists;
/**
* Doctrine\Tests\ORM\Mapping\DefaultQuoteStrategyTest
*/
class DefaultQuoteStrategyTest extends OrmTestCase
{
#[Group('DDC-3590')]
#[Group('DDC-1316')]
#[RequiresPhpunit('< 12')]
public function testGetJoinTableName(): void
{
$em = $this->getTestEntityManager();
$metadata = $em->getClassMetadata(NonPublicSchemaUser::class);
$strategy = new DefaultQuoteStrategy();
$platform = $this->getMockForAbstractClass(AbstractPlatform::class, enum_exists(UnquotedIdentifierFolding::class) ? [UnquotedIdentifierFolding::UPPER] : []);
assert($platform instanceof AbstractPlatform);
self::assertSame(
'readers.author_reader',
$strategy->getJoinTableName($metadata->associationMappings['readers'], $metadata, $platform),
);
}
}
|