Skip to content

Commit

Permalink
Fixed CS
Browse files Browse the repository at this point in the history
  • Loading branch information
belgattitude authored and lcobucci committed Nov 19, 2017
1 parent a04d804 commit 6fa8549
Showing 1 changed file with 14 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ protected function setUp()
{
parent::setUp();

if ( ! Type::hasType('point')) {
if (!Type::hasType('point')) {
Type::addType('point', MySqlPointType::class);
}
}
Expand All @@ -30,7 +30,7 @@ public function testSwitchPrimaryKeyColumns()

$this->_sm->createTable($tableOld);
$tableFetched = $this->_sm->listTableDetails("switch_primary_key_columns");
$tableNew = clone $tableFetched;
$tableNew = clone $tableFetched;
$tableNew->setPrimaryKey(array('bar_id', 'foo_id'));

$comparator = new Comparator;
Expand All @@ -47,7 +47,7 @@ public function testSwitchPrimaryKeyColumns()
public function testDiffTableBug()
{
$schema = new Schema();
$table = $schema->createTable('diffbug_routing_translations');
$table = $schema->createTable('diffbug_routing_translations');
$table->addColumn('id', 'integer');
$table->addColumn('route', 'string');
$table->addColumn('locale', 'string');
Expand All @@ -62,7 +62,7 @@ public function testDiffTableBug()
$tableFetched = $this->_sm->listTableDetails("diffbug_routing_translations");

$comparator = new Comparator;
$diff = $comparator->diffTable($tableFetched, $table);
$diff = $comparator->diffTable($tableFetched, $table);

self::assertFalse($diff, "no changes expected.");
}
Expand Down Expand Up @@ -197,7 +197,7 @@ public function testDoesNotPropagateDefaultValuesForUnsupportedColumnTypes()

public function testColumnCollation()
{
$table = new Table('test_collation');
$table = new Table('test_collation');
$table->addOption('collate', $collation = 'latin1_swedish_ci');
$table->addOption('charset', 'latin1');
$table->addColumn('id', 'integer');
Expand All @@ -220,7 +220,7 @@ public function testColumnCollation()
public function testListLobTypeColumns()
{
$tableName = 'lob_type_columns';
$table = new Table($tableName);
$table = new Table($tableName);

$table->addColumn('col_tinytext', 'text', array('length' => MySqlPlatform::LENGTH_LIMIT_TINYTEXT));
$table->addColumn('col_text', 'text', array('length' => MySqlPlatform::LENGTH_LIMIT_TEXT));
Expand All @@ -234,9 +234,9 @@ public function testListLobTypeColumns()

$this->_sm->dropAndCreateTable($table);

$platform = $this->_sm->getDatabasePlatform();
$platform = $this->_sm->getDatabasePlatform();
$offlineColumns = $table->getColumns();
$onlineColumns = $this->_sm->listTableColumns($tableName);
$onlineColumns = $this->_sm->listTableColumns($tableName);

self::assertSame(
$platform->getClobTypeDeclarationSQL($offlineColumns['col_tinytext']->toArray()),
Expand Down Expand Up @@ -299,7 +299,7 @@ public function testDiffListGuidTableColumn()
public function testListDecimalTypeColumns()
{
$tableName = 'test_list_decimal_columns';
$table = new Table($tableName);
$table = new Table($tableName);

$table->addColumn('col', 'decimal');
$table->addColumn('col_unsigned', 'decimal', array('unsigned' => true));
Expand All @@ -320,7 +320,7 @@ public function testListDecimalTypeColumns()
public function testListFloatTypeColumns()
{
$tableName = 'test_list_float_columns';
$table = new Table($tableName);
$table = new Table($tableName);

$table->addColumn('col', 'float');
$table->addColumn('col_unsigned', 'float', array('unsigned' => true));
Expand Down Expand Up @@ -376,7 +376,6 @@ public function testColumnDefaultCurrentTimestamp() : void

public function testColumnDefaultsAreValid()
{

$table = new Table("test_column_defaults_are_valid");

$currentTimeStampSql = $this->_sm->getDatabasePlatform()->getCurrentTimestampSQL();
Expand Down Expand Up @@ -461,7 +460,6 @@ public function testEnsureDefaultsAreUnescapedFromSchemaIntrospection() : void
$platform = $this->_sm->getDatabasePlatform();
$this->_conn->query('DROP TABLE IF EXISTS test_column_defaults_with_create');

// https://dev.mysql.com/doc/refman/5.7/en/string-literals.html
$escapeSequences = [
"\\0", // An ASCII NUL (X'00') character
"\\'", "''", // Single quote
Expand All @@ -475,14 +473,13 @@ public function testEnsureDefaultsAreUnescapedFromSchemaIntrospection() : void
'\\%', // A percent (%) character
'\\_', // An underscore (_) character
];
$default = implode('+', $escapeSequences);

$sql = "CREATE TABLE test_column_defaults_with_create(
col1 VARCHAR(255) NULL DEFAULT {$platform->quoteStringLiteral($default)}
)";
$default = implode('+', $escapeSequences);

$sql = "CREATE TABLE test_column_defaults_with_create(
col1 VARCHAR(255) NULL DEFAULT {$platform->quoteStringLiteral($default)}
)";
$this->_conn->query($sql);

$onlineTable = $this->_sm->listTableDetails("test_column_defaults_with_create");
self::assertSame($default, $onlineTable->getColumn('col1')->getDefault());
}
Expand Down

0 comments on commit 6fa8549

Please sign in to comment.