Code Duplication    Length = 17-18 lines in 2 locations

tests/Doctrine/Tests/DBAL/Functional/Schema/DrizzleSchemaManagerTest.php 1 location

@@ 30-46 (lines=17) @@
27
        $this->assertFalse($table->getColumn('column_binary')->getFixed());
28
    }
29
30
    public function testColumnCollation()
31
    {
32
        $table = new Table('test_collation');
33
        $table->addOption('collate', $collation = 'utf8_unicode_ci');
34
        $table->addColumn('id', 'integer');
35
        $table->addColumn('text', 'text');
36
        $table->addColumn('foo', 'text')->setPlatformOption('collation', 'utf8_swedish_ci');
37
        $table->addColumn('bar', 'text')->setPlatformOption('collation', 'utf8_general_ci');
38
        $this->_sm->dropAndCreateTable($table);
39
40
        $columns = $this->_sm->listTableColumns('test_collation');
41
42
        $this->assertArrayNotHasKey('collation', $columns['id']->getPlatformOptions());
43
        $this->assertEquals('utf8_unicode_ci', $columns['text']->getPlatformOption('collation'));
44
        $this->assertEquals('utf8_swedish_ci', $columns['foo']->getPlatformOption('collation'));
45
        $this->assertEquals('utf8_general_ci', $columns['bar']->getPlatformOption('collation'));
46
    }
47
}
48

tests/Doctrine/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php 1 location

@@ 198-215 (lines=18) @@
195
        $this->assertFalse($comparator->diffTable($table, $onlineTable));
196
    }
197
198
    public function testColumnCollation()
199
    {
200
        $table = new Table('test_collation');
201
        $table->addOption('collate', $collation = 'latin1_swedish_ci');
202
        $table->addOption('charset', 'latin1');
203
        $table->addColumn('id', 'integer');
204
        $table->addColumn('text', 'text');
205
        $table->addColumn('foo', 'text')->setPlatformOption('collation', 'latin1_swedish_ci');
206
        $table->addColumn('bar', 'text')->setPlatformOption('collation', 'utf8_general_ci');
207
        $this->_sm->dropAndCreateTable($table);
208
209
        $columns = $this->_sm->listTableColumns('test_collation');
210
211
        $this->assertArrayNotHasKey('collation', $columns['id']->getPlatformOptions());
212
        $this->assertEquals('latin1_swedish_ci', $columns['text']->getPlatformOption('collation'));
213
        $this->assertEquals('latin1_swedish_ci', $columns['foo']->getPlatformOption('collation'));
214
        $this->assertEquals('utf8_general_ci', $columns['bar']->getPlatformOption('collation'));
215
    }
216
217
    /**
218
     * @group DBAL-843