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

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