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