AbstractSQLServerDriverTest.php 1.03 KB
Newer Older
1 2
<?php

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

use Doctrine\DBAL\Connection;
6
use Doctrine\DBAL\Driver\AbstractSQLServerDriver\Exception\PortWithoutHost;
7
use Doctrine\DBAL\Platforms\AbstractPlatform;
8
use Doctrine\DBAL\Platforms\SQLServer2012Platform;
9
use Doctrine\DBAL\Schema\AbstractSchemaManager;
10 11
use Doctrine\DBAL\Schema\SQLServerSchemaManager;

12
abstract class AbstractSQLServerDriverTest extends AbstractDriverTest
13
{
14
    protected function createPlatform(): AbstractPlatform
15
    {
16
        return new SQLServer2012Platform();
17 18
    }

19
    protected function createSchemaManager(Connection $connection): AbstractSchemaManager
20 21 22 23
    {
        return new SQLServerSchemaManager($connection);
    }

24 25 26
    /**
     * {@inheritDoc}
     */
27
    protected function getDatabasePlatformsForVersions(): array
28
    {
Sergei Morozov's avatar
Sergei Morozov committed
29
        return [
30
            ['12', SQLServer2012Platform::class],
Sergei Morozov's avatar
Sergei Morozov committed
31
        ];
32
    }
33 34 35 36 37 38

    public function testPortWithoutHost(): void
    {
        $this->expectException(PortWithoutHost::class);
        $this->driver->connect(['port' => 1433]);
    }
39
}