-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
ComparatorTest.php
39 lines (28 loc) · 990 Bytes
/
ComparatorTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
declare(strict_types=1);
namespace Doctrine\Tests\DBAL\Functional\Schema;
use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\Comparator;
use Doctrine\DBAL\Schema\Table;
use Doctrine\Tests\DbalFunctionalTestCase;
class ComparatorTest extends DbalFunctionalTestCase
{
/** @var AbstractSchemaManager */
private $schemaManager;
/** @var Comparator */
private $comparator;
protected function setUp()
{
parent::setUp();
$this->schemaManager = $this->connection->getSchemaManager();
$this->comparator = new Comparator();
}
public function testDefaultValueComparison()
{
$table = new Table('default_value');
$table->addColumn('id', 'integer', ['default' => 1]);
$this->schemaManager->createTable($table);
$onlineTable = $this->schemaManager->listTableDetails('default_value');
self::assertFalse($this->comparator->diffTable($table, $onlineTable));
}
}