Total Complexity | 3 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
12 | class ComparatorTest extends DbalFunctionalTestCase |
||
13 | { |
||
14 | /** @var AbstractSchemaManager */ |
||
15 | private $schemaManager; |
||
16 | |||
17 | /** @var Comparator */ |
||
18 | private $comparator; |
||
19 | |||
20 | protected function setUp() : void |
||
21 | { |
||
22 | parent::setUp(); |
||
23 | |||
24 | $this->schemaManager = $this->connection->getSchemaManager(); |
||
25 | $this->comparator = new Comparator(); |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * @param mixed $value |
||
30 | * |
||
31 | * @dataProvider defaultValueProvider |
||
32 | */ |
||
33 | public function testDefaultValueComparison(string $type, $value) : void |
||
34 | { |
||
35 | $table = new Table('default_value'); |
||
36 | $table->addColumn('test', $type, ['default' => $value]); |
||
37 | |||
38 | $this->schemaManager->dropAndCreateTable($table); |
||
39 | |||
40 | $onlineTable = $this->schemaManager->listTableDetails('default_value'); |
||
41 | |||
42 | self::assertFalse($this->comparator->diffTable($table, $onlineTable)); |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * @return mixed[][] |
||
47 | */ |
||
48 | public static function defaultValueProvider() : iterable |
||
53 | ]; |
||
54 | } |
||
55 | } |
||
56 |