Skip to content

Commit

Permalink
Fix tests assertion, remove useless test case and comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
cyhii committed Dec 29, 2018
1 parent 6cb62a3 commit 1c02433
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 19 deletions.
5 changes: 0 additions & 5 deletions lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,6 @@ protected function _getPortableTableColumnDefinition($tableColumn)

$column = new Column($tableColumn['field'], Type::getType($type), $options);

/**
* The key 'characterset' in $tableColumn is from MySql platform implementation
*
* @see MySqlPlatform::getListTableColumnsSQL()
*/
if (isset($tableColumn['characterset'])) {
$column->setPlatformOption('charset', $tableColumn['characterset']);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public function testColumnCharset()

$columns = $this->schemaManager->listTableColumns('test_column_charset');

self::assertArrayNotHasKey('collation', $columns['id']->getPlatformOptions());
self::assertFalse($columns['id']->hasPlatformOption('charset'));
self::assertEquals('utf8', $columns['no_charset']->getPlatformOption('charset'));
self::assertEquals('ascii', $columns['foo']->getPlatformOption('charset'));
self::assertEquals('latin1', $columns['bar']->getPlatformOption('charset'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -913,19 +913,6 @@ public function testColumnCharsetDeclarationSQL() : void
);
}

public function testGetCreateTableSQLWithColumnCharset() : void
{
$table = new Table('test_column_charset');
$table->addColumn('no_charset', 'string');
$table->addColumn('column_charset', 'string')->setPlatformOption('charset', 'ascii');

self::assertSame(
['CREATE TABLE test_column_charset (no_charset VARCHAR(255) NOT NULL, column_charset VARCHAR(255) CHARACTER SET ascii NOT NULL) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'],
$this->platform->getCreateTableSQL($table),
'Column "no_charset" will use the default charset from the table/database and "column_charset" overwrites the charset on this column'
);
}

public function testSupportsColumnCollation() : void
{
self::assertTrue($this->platform->supportsColumnCollation());
Expand Down

0 comments on commit 1c02433

Please sign in to comment.