1 | <?php |
||
2 | |||
3 | namespace Doctrine\Tests\DBAL\Platforms; |
||
4 | |||
5 | use Doctrine\DBAL\Platforms\PostgreSQL92Platform; |
||
6 | use Doctrine\DBAL\Types\Type; |
||
7 | |||
8 | class PostgreSQL92PlatformTest extends AbstractPostgreSqlPlatformTestCase |
||
9 | { |
||
10 | /** |
||
11 | * {@inheritdoc} |
||
12 | */ |
||
13 | public function createPlatform() |
||
14 | { |
||
15 | return new PostgreSQL92Platform(); |
||
16 | } |
||
17 | |||
18 | /** |
||
19 | * @group DBAL-553 |
||
20 | */ |
||
21 | public function testHasNativeJsonType() |
||
22 | { |
||
23 | self::assertTrue($this->_platform->hasNativeJsonType()); |
||
24 | } |
||
25 | |||
26 | /** |
||
27 | * @group DBAL-553 |
||
28 | */ |
||
29 | public function testReturnsJsonTypeDeclarationSQL() |
||
30 | { |
||
31 | self::assertSame('JSON', $this->_platform->getJsonTypeDeclarationSQL(array())); |
||
32 | } |
||
33 | |||
34 | public function testReturnsSmallIntTypeDeclarationSQL() |
||
35 | { |
||
36 | self::assertSame( |
||
37 | 'SMALLSERIAL', |
||
38 | $this->_platform->getSmallIntTypeDeclarationSQL(array('autoincrement' => true)) |
||
39 | ); |
||
40 | |||
41 | self::assertSame( |
||
42 | 'SMALLINT', |
||
43 | $this->_platform->getSmallIntTypeDeclarationSQL(array('autoincrement' => false)) |
||
44 | ); |
||
45 | |||
46 | self::assertSame( |
||
47 | 'SMALLINT', |
||
48 | $this->_platform->getSmallIntTypeDeclarationSQL(array()) |
||
49 | ); |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * @group DBAL-553 |
||
54 | */ |
||
55 | public function testInitializesJsonTypeMapping() |
||
56 | { |
||
57 | self::assertTrue($this->_platform->hasDoctrineTypeMappingFor('json')); |
||
58 | self::assertEquals(Type::JSON, $this->_platform->getDoctrineTypeMapping('json')); |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * @group DBAL-1220 |
||
63 | */ |
||
64 | public function testReturnsCloseActiveDatabaseConnectionsSQL() |
||
65 | { |
||
66 | self::assertSame( |
||
67 | "SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = 'foo'", |
||
68 | $this->_platform->getCloseActiveDatabaseConnectionsSQL('foo') |
||
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
69 | ); |
||
70 | } |
||
71 | } |
||
72 |