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

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