AbstractPostgreSQLDriverTest.php 1.47 KB
Newer Older
1 2
<?php

3
namespace Doctrine\DBAL\Tests\Driver;
4 5

use Doctrine\DBAL\Connection;
6
use Doctrine\DBAL\Driver;
Sergei Morozov's avatar
Sergei Morozov committed
7
use Doctrine\DBAL\Driver\AbstractPostgreSQLDriver;
8 9
use Doctrine\DBAL\Driver\API\ExceptionConverter;
use Doctrine\DBAL\Driver\API\PostgreSQL;
10
use Doctrine\DBAL\Platforms\AbstractPlatform;
11
use Doctrine\DBAL\Platforms\PostgreSQL100Platform;
12
use Doctrine\DBAL\Platforms\PostgreSQL94Platform;
13
use Doctrine\DBAL\Schema\AbstractSchemaManager;
14 15 16 17
use Doctrine\DBAL\Schema\PostgreSqlSchemaManager;

class AbstractPostgreSQLDriverTest extends AbstractDriverTest
{
18
    protected function createDriver(): Driver
19
    {
Sergei Morozov's avatar
Sergei Morozov committed
20
        return $this->getMockForAbstractClass(AbstractPostgreSQLDriver::class);
21 22
    }

23
    protected function createPlatform(): AbstractPlatform
24
    {
25
        return new PostgreSQL94Platform();
26 27
    }

28
    protected function createSchemaManager(Connection $connection): AbstractSchemaManager
29
    {
30 31 32 33
        return new PostgreSqlSchemaManager(
            $connection,
            $this->createPlatform()
        );
34 35
    }

36 37 38 39 40
    protected function createExceptionConverter(): ExceptionConverter
    {
        return new PostgreSQL\ExceptionConverter();
    }

41 42 43
    /**
     * {@inheritDoc}
     */
44
    protected function getDatabasePlatformsForVersions(): array
45
    {
Sergei Morozov's avatar
Sergei Morozov committed
46
        return [
47 48 49
            ['9.4', PostgreSQL94Platform::class],
            ['9.4.0', PostgreSQL94Platform::class],
            ['9.4.1', PostgreSQL94Platform::class],
Sergei Morozov's avatar
Sergei Morozov committed
50 51
            ['10', PostgreSQL100Platform::class],
        ];
52 53
    }
}