PostgreSQL94PlatformTest.php 974 Bytes
Newer Older
1 2 3 4
<?php

namespace Doctrine\Tests\DBAL\Platforms;

5
use Doctrine\DBAL\Platforms\AbstractPlatform;
6
use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
7
use Doctrine\DBAL\Types\Types;
8 9 10

class PostgreSQL94PlatformTest extends PostgreSQL92PlatformTest
{
11
    public function createPlatform() : AbstractPlatform
12 13 14 15
    {
        return new PostgreSQL94Platform();
    }

16
    public function testReturnsJsonTypeDeclarationSQL() : void
17 18
    {
        parent::testReturnsJsonTypeDeclarationSQL();
Sergei Morozov's avatar
Sergei Morozov committed
19 20
        self::assertSame('JSON', $this->platform->getJsonTypeDeclarationSQL(['jsonb' => false]));
        self::assertSame('JSONB', $this->platform->getJsonTypeDeclarationSQL(['jsonb' => true]));
21 22
    }

23
    public function testInitializesJsonTypeMapping() : void
24 25
    {
        parent::testInitializesJsonTypeMapping();
Sergei Morozov's avatar
Sergei Morozov committed
26
        self::assertTrue($this->platform->hasDoctrineTypeMappingFor('jsonb'));
27
        self::assertEquals(Types::JSON, $this->platform->getDoctrineTypeMapping('jsonb'));
28 29
    }
}