Completed
Push — master ( 296b0e...9dbec4 )
by Sergei
17s queued 12s
created

ComparatorTest::testDefaultValueComparison()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 10
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Doctrine\Tests\DBAL\Functional\Schema;
6
7
use Doctrine\DBAL\Schema\AbstractSchemaManager;
8
use Doctrine\DBAL\Schema\Comparator;
9
use Doctrine\DBAL\Schema\Table;
10
use Doctrine\Tests\DbalFunctionalTestCase;
11
12
class ComparatorTest extends DbalFunctionalTestCase
13
{
14
    /** @var AbstractSchemaManager */
15
    private $schemaManager;
16
17
    /** @var Comparator */
18
    private $comparator;
19
20
    protected function setUp()
21
    {
22
        parent::setUp();
23
24
        $this->schemaManager = $this->connection->getSchemaManager();
25
        $this->comparator    = new Comparator();
26
    }
27
28
    public function testDefaultValueComparison()
29
    {
30
        $table = new Table('default_value');
31
        $table->addColumn('id', 'integer', ['default' => 1]);
32
33
        $this->schemaManager->createTable($table);
34
35
        $onlineTable = $this->schemaManager->listTableDetails('default_value');
36
37
        self::assertFalse($this->comparator->diffTable($table, $onlineTable));
38
    }
39
}
40