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

@@ 183-200 (lines=18) @@
180
        $this->assertFalse($onlineTable->getColumn('def_blob_null')->getNotnull());
181
    }
182
183
    public function testColumnCollation()
184
    {
185
        $table = new Table('test_collation');
186
        $table->addOption('collate', $collation = 'latin1_swedish_ci');
187
        $table->addOption('charset', 'latin1');
188
        $table->addColumn('id', 'integer');
189
        $table->addColumn('text', 'text');
190
        $table->addColumn('foo', 'text')->setPlatformOption('collation', 'latin1_swedish_ci');
191
        $table->addColumn('bar', 'text')->setPlatformOption('collation', 'utf8_general_ci');
192
        $this->_sm->dropAndCreateTable($table);
193
194
        $columns = $this->_sm->listTableColumns('test_collation');
195
196
        $this->assertArrayNotHasKey('collation', $columns['id']->getPlatformOptions());
197
        $this->assertEquals('latin1_swedish_ci', $columns['text']->getPlatformOption('collation'));
198
        $this->assertEquals('latin1_swedish_ci', $columns['foo']->getPlatformOption('collation'));
199
        $this->assertEquals('utf8_general_ci', $columns['bar']->getPlatformOption('collation'));
200
    }
201
202
    /**
203
     * @group DBAL-843