File: DefaultQuoteStrategyTest.php

package info (click to toggle)
doctrine 3.3.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 11,236 kB
  • sloc: php: 105,633; xml: 1,312; makefile: 35; sh: 14
file content (39 lines) | stat: -rw-r--r-- 1,301 bytes parent folder | download
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),
        );
    }
}