Code Duplication    Length = 17-18 lines in 2 locations

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

@@ 30-46 (lines=17) @@
27
        self::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
        self::assertArrayNotHasKey('collation', $columns['id']->getPlatformOptions());
43
        self::assertEquals('utf8_unicode_ci', $columns['text']->getPlatformOption('collation'));
44
        self::assertEquals('utf8_swedish_ci', $columns['foo']->getPlatformOption('collation'));
45
        self::assertEquals('utf8_general_ci', $columns['bar']->getPlatformOption('collation'));
46
    }
47
}
48

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

@@ 227-244 (lines=18) @@
224
        self::assertFalse($comparator->diffTable($table, $onlineTable));
225
    }
226
227
    public function testColumnCollation()
228
    {
229
        $table = new Table('test_collation');
230
        $table->addOption('collate', $collation = 'latin1_swedish_ci');
231
        $table->addOption('charset', 'latin1');
232
        $table->addColumn('id', 'integer');
233
        $table->addColumn('text', 'text');
234
        $table->addColumn('foo', 'text')->setPlatformOption('collation', 'latin1_swedish_ci');
235
        $table->addColumn('bar', 'text')->setPlatformOption('collation', 'utf8_general_ci');
236
        $this->_sm->dropAndCreateTable($table);
237
238
        $columns = $this->_sm->listTableColumns('test_collation');
239
240
        self::assertArrayNotHasKey('collation', $columns['id']->getPlatformOptions());
241
        self::assertEquals('latin1_swedish_ci', $columns['text']->getPlatformOption('collation'));
242
        self::assertEquals('latin1_swedish_ci', $columns['foo']->getPlatformOption('collation'));
243
        self::assertEquals('utf8_general_ci', $columns['bar']->getPlatformOption('collation'));
244
    }
245
246
    /**
247
     * @group DBAL-843