Passed
Branch tests-better-coverage (52d7f0)
by Michael
04:07
created
Doctrine/Tests/DBAL/Functional/Schema/SchemaManagerFunctionalTestCase.php 1 patch
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      */
81 81
     public function testDropsDatabaseWithActiveConnections()
82 82
     {
83
-        if (! $this->_sm->getDatabasePlatform()->supportsCreateDropDatabase()) {
83
+        if ( ! $this->_sm->getDatabasePlatform()->supportsCreateDropDatabase()) {
84 84
             $this->markTestSkipped('Cannot drop Database client side with this Driver.');
85 85
         }
86 86
 
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
     public function testDropAndCreateSequence()
119 119
     {
120 120
         if ( ! $this->_conn->getDatabasePlatform()->supportsSequences()) {
121
-            $this->markTestSkipped($this->_conn->getDriver()->getName().' does not support sequences.');
121
+            $this->markTestSkipped($this->_conn->getDriver()->getName() . ' does not support sequences.');
122 122
         }
123 123
 
124 124
         $name = 'dropcreate_sequences_test_seq';
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
     {
133 133
         $filteredList = array_filter(
134 134
             $items,
135
-            function (\Doctrine\DBAL\Schema\AbstractAsset $item) use ($name) : bool {
135
+            function(\Doctrine\DBAL\Schema\AbstractAsset $item) use ($name) : bool {
136 136
                 return $item->getShortestName($item->getNamespaceName()) === $name;
137 137
             }
138 138
         );
@@ -142,8 +142,8 @@  discard block
 block discarded – undo
142 142
 
143 143
     public function testListSequences()
144 144
     {
145
-        if(!$this->_conn->getDatabasePlatform()->supportsSequences()) {
146
-            $this->markTestSkipped($this->_conn->getDriver()->getName().' does not support sequences.');
145
+        if ( ! $this->_conn->getDatabasePlatform()->supportsSequences()) {
146
+            $this->markTestSkipped($this->_conn->getDriver()->getName() . ' does not support sequences.');
147 147
         }
148 148
 
149 149
         $sequence = new \Doctrine\DBAL\Schema\Sequence('list_sequences_test_seq', 20, 10);
@@ -154,9 +154,9 @@  discard block
 block discarded – undo
154 154
         self::assertInternalType('array', $sequences, 'listSequences() should return an array.');
155 155
 
156 156
         $foundSequence = null;
157
-        foreach($sequences as $sequence) {
157
+        foreach ($sequences as $sequence) {
158 158
             self::assertInstanceOf('Doctrine\DBAL\Schema\Sequence', $sequence, 'Array elements of listSequences() should be Sequence instances.');
159
-            if(strtolower($sequence->getName()) == 'list_sequences_test_seq') {
159
+            if (strtolower($sequence->getName()) == 'list_sequences_test_seq') {
160 160
                 $foundSequence = $sequence;
161 161
             }
162 162
         }
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 
169 169
     public function testListDatabases()
170 170
     {
171
-        if (!$this->_sm->getDatabasePlatform()->supportsCreateDropDatabase()) {
171
+        if ( ! $this->_sm->getDatabasePlatform()->supportsCreateDropDatabase()) {
172 172
             $this->markTestSkipped('Cannot drop Database client side with this Driver.');
173 173
         }
174 174
 
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
      */
186 186
     public function testListNamespaceNames()
187 187
     {
188
-        if (!$this->_sm->getDatabasePlatform()->supportsSchemas()) {
188
+        if ( ! $this->_sm->getDatabasePlatform()->supportsSchemas()) {
189 189
             $this->markTestSkipped('Platform does not support schemas.');
190 190
         }
191 191
 
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
         $namespaces = $this->_sm->listNamespaceNames();
194 194
         $namespaces = array_map('strtolower', $namespaces);
195 195
 
196
-        if (!in_array('test_create_schema', $namespaces)) {
196
+        if ( ! in_array('test_create_schema', $namespaces)) {
197 197
             $this->_conn->executeUpdate($this->_sm->getDatabasePlatform()->getCreateSchemaSQL('test_create_schema'));
198 198
 
199 199
             $namespaces = $this->_sm->listNamespaceNames();
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
             }
224 224
         }
225 225
 
226
-        self::assertTrue( $foundTable , "The 'list_tables_test' table has to be found.");
226
+        self::assertTrue($foundTable, "The 'list_tables_test' table has to be found.");
227 227
     }
228 228
 
229 229
     public function createListTableColumns()
@@ -252,64 +252,64 @@  discard block
 block discarded – undo
252 252
 
253 253
         self::assertArrayHasKey('id', $columns);
254 254
         self::assertEquals(0, array_search('id', $columnsKeys));
255
-        self::assertEquals('id',   strtolower($columns['id']->getname()));
255
+        self::assertEquals('id', strtolower($columns['id']->getname()));
256 256
         self::assertInstanceOf('Doctrine\DBAL\Types\IntegerType', $columns['id']->gettype());
257
-        self::assertEquals(false,  $columns['id']->getunsigned());
258
-        self::assertEquals(true,   $columns['id']->getnotnull());
259
-        self::assertEquals(null,   $columns['id']->getdefault());
260
-        self::assertInternalType('array',  $columns['id']->getPlatformOptions());
257
+        self::assertEquals(false, $columns['id']->getunsigned());
258
+        self::assertEquals(true, $columns['id']->getnotnull());
259
+        self::assertEquals(null, $columns['id']->getdefault());
260
+        self::assertInternalType('array', $columns['id']->getPlatformOptions());
261 261
 
262 262
         self::assertArrayHasKey('test', $columns);
263 263
         self::assertEquals(1, array_search('test', $columnsKeys));
264 264
         self::assertEquals('test', strtolower($columns['test']->getname()));
265 265
         self::assertInstanceOf('Doctrine\DBAL\Types\StringType', $columns['test']->gettype());
266
-        self::assertEquals(255,    $columns['test']->getlength());
267
-        self::assertEquals(false,  $columns['test']->getfixed());
268
-        self::assertEquals(false,  $columns['test']->getnotnull());
269
-        self::assertEquals('expected default',   $columns['test']->getdefault());
270
-        self::assertInternalType('array',  $columns['test']->getPlatformOptions());
266
+        self::assertEquals(255, $columns['test']->getlength());
267
+        self::assertEquals(false, $columns['test']->getfixed());
268
+        self::assertEquals(false, $columns['test']->getnotnull());
269
+        self::assertEquals('expected default', $columns['test']->getdefault());
270
+        self::assertInternalType('array', $columns['test']->getPlatformOptions());
271 271
 
272
-        self::assertEquals('foo',  strtolower($columns['foo']->getname()));
272
+        self::assertEquals('foo', strtolower($columns['foo']->getname()));
273 273
         self::assertEquals(2, array_search('foo', $columnsKeys));
274 274
         self::assertInstanceOf('Doctrine\DBAL\Types\TextType', $columns['foo']->gettype());
275
-        self::assertEquals(false,  $columns['foo']->getunsigned());
276
-        self::assertEquals(false,  $columns['foo']->getfixed());
277
-        self::assertEquals(true,   $columns['foo']->getnotnull());
278
-        self::assertEquals(null,   $columns['foo']->getdefault());
279
-        self::assertInternalType('array',  $columns['foo']->getPlatformOptions());
275
+        self::assertEquals(false, $columns['foo']->getunsigned());
276
+        self::assertEquals(false, $columns['foo']->getfixed());
277
+        self::assertEquals(true, $columns['foo']->getnotnull());
278
+        self::assertEquals(null, $columns['foo']->getdefault());
279
+        self::assertInternalType('array', $columns['foo']->getPlatformOptions());
280 280
 
281
-        self::assertEquals('bar',  strtolower($columns['bar']->getname()));
281
+        self::assertEquals('bar', strtolower($columns['bar']->getname()));
282 282
         self::assertEquals(3, array_search('bar', $columnsKeys));
283 283
         self::assertInstanceOf('Doctrine\DBAL\Types\DecimalType', $columns['bar']->gettype());
284
-        self::assertEquals(null,   $columns['bar']->getlength());
285
-        self::assertEquals(10,     $columns['bar']->getprecision());
286
-        self::assertEquals(4,      $columns['bar']->getscale());
287
-        self::assertEquals(false,  $columns['bar']->getunsigned());
288
-        self::assertEquals(false,  $columns['bar']->getfixed());
289
-        self::assertEquals(false,  $columns['bar']->getnotnull());
290
-        self::assertEquals(null,   $columns['bar']->getdefault());
291
-        self::assertInternalType('array',  $columns['bar']->getPlatformOptions());
284
+        self::assertEquals(null, $columns['bar']->getlength());
285
+        self::assertEquals(10, $columns['bar']->getprecision());
286
+        self::assertEquals(4, $columns['bar']->getscale());
287
+        self::assertEquals(false, $columns['bar']->getunsigned());
288
+        self::assertEquals(false, $columns['bar']->getfixed());
289
+        self::assertEquals(false, $columns['bar']->getnotnull());
290
+        self::assertEquals(null, $columns['bar']->getdefault());
291
+        self::assertInternalType('array', $columns['bar']->getPlatformOptions());
292 292
 
293 293
         self::assertEquals('baz1', strtolower($columns['baz1']->getname()));
294 294
         self::assertEquals(4, array_search('baz1', $columnsKeys));
295 295
         self::assertInstanceOf('Doctrine\DBAL\Types\DateTimeType', $columns['baz1']->gettype());
296
-        self::assertEquals(true,   $columns['baz1']->getnotnull());
297
-        self::assertEquals(null,   $columns['baz1']->getdefault());
298
-        self::assertInternalType('array',  $columns['baz1']->getPlatformOptions());
296
+        self::assertEquals(true, $columns['baz1']->getnotnull());
297
+        self::assertEquals(null, $columns['baz1']->getdefault());
298
+        self::assertInternalType('array', $columns['baz1']->getPlatformOptions());
299 299
 
300 300
         self::assertEquals('baz2', strtolower($columns['baz2']->getname()));
301 301
         self::assertEquals(5, array_search('baz2', $columnsKeys));
302 302
         self::assertContains($columns['baz2']->gettype()->getName(), array('time', 'date', 'datetime'));
303
-        self::assertEquals(true,   $columns['baz2']->getnotnull());
304
-        self::assertEquals(null,   $columns['baz2']->getdefault());
305
-        self::assertInternalType('array',  $columns['baz2']->getPlatformOptions());
303
+        self::assertEquals(true, $columns['baz2']->getnotnull());
304
+        self::assertEquals(null, $columns['baz2']->getdefault());
305
+        self::assertInternalType('array', $columns['baz2']->getPlatformOptions());
306 306
 
307 307
         self::assertEquals('baz3', strtolower($columns['baz3']->getname()));
308 308
         self::assertEquals(6, array_search('baz3', $columnsKeys));
309 309
         self::assertContains($columns['baz3']->gettype()->getName(), array('time', 'date', 'datetime'));
310
-        self::assertEquals(true,   $columns['baz3']->getnotnull());
311
-        self::assertEquals(null,   $columns['baz3']->getdefault());
312
-        self::assertInternalType('array',  $columns['baz3']->getPlatformOptions());
310
+        self::assertEquals(true, $columns['baz3']->getnotnull());
311
+        self::assertEquals(null, $columns['baz3']->getdefault());
312
+        self::assertInternalType('array', $columns['baz3']->getPlatformOptions());
313 313
     }
314 314
 
315 315
     /**
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
         $tableIndexes = $this->_sm->listTableIndexes('test_create_index');
441 441
         self::assertInternalType('array', $tableIndexes);
442 442
 
443
-        self::assertEquals('test',        strtolower($tableIndexes['test']->getName()));
443
+        self::assertEquals('test', strtolower($tableIndexes['test']->getName()));
444 444
         self::assertEquals(array('test'), array_map('strtolower', $tableIndexes['test']->getColumns()));
445 445
         self::assertTrue($tableIndexes['test']->isUnique());
446 446
         self::assertFalse($tableIndexes['test']->isPrimary());
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
 
449 449
     public function testCreateTableWithForeignKeys()
450 450
     {
451
-        if(!$this->_sm->getDatabasePlatform()->supportsForeignKeyConstraints()) {
451
+        if ( ! $this->_sm->getDatabasePlatform()->supportsForeignKeyConstraints()) {
452 452
             $this->markTestSkipped('Platform does not support foreign keys.');
453 453
         }
454 454
 
@@ -467,16 +467,16 @@  discard block
 block discarded – undo
467 467
 
468 468
         $fkConstraint = current($fkConstraints);
469 469
         self::assertInstanceOf('\Doctrine\DBAL\Schema\ForeignKeyConstraint', $fkConstraint);
470
-        self::assertEquals('test_foreign',             strtolower($fkConstraint->getForeignTableName()));
471
-        self::assertEquals(array('foreign_key_test'),  array_map('strtolower', $fkConstraint->getColumns()));
472
-        self::assertEquals(array('id'),                array_map('strtolower', $fkConstraint->getForeignColumns()));
470
+        self::assertEquals('test_foreign', strtolower($fkConstraint->getForeignTableName()));
471
+        self::assertEquals(array('foreign_key_test'), array_map('strtolower', $fkConstraint->getColumns()));
472
+        self::assertEquals(array('id'), array_map('strtolower', $fkConstraint->getForeignColumns()));
473 473
 
474 474
         self::assertTrue($fkTable->columnsAreIndexed($fkConstraint->getColumns()), "The columns of a foreign key constraint should always be indexed.");
475 475
     }
476 476
 
477 477
     public function testListForeignKeys()
478 478
     {
479
-        if(!$this->_conn->getDatabasePlatform()->supportsForeignKeyConstraints()) {
479
+        if ( ! $this->_conn->getDatabasePlatform()->supportsForeignKeyConstraints()) {
480 480
             $this->markTestSkipped('Does not support foreign key constraints.');
481 481
         }
482 482
 
@@ -494,11 +494,11 @@  discard block
 block discarded – undo
494 494
         self::assertEquals(1, count($fkeys), "Table 'test_create_fk1' has to have one foreign key.");
495 495
 
496 496
         self::assertInstanceOf('Doctrine\DBAL\Schema\ForeignKeyConstraint', $fkeys[0]);
497
-        self::assertEquals(array('foreign_key_test'),  array_map('strtolower', $fkeys[0]->getLocalColumns()));
498
-        self::assertEquals(array('id'),                array_map('strtolower', $fkeys[0]->getForeignColumns()));
499
-        self::assertEquals('test_create_fk2',          strtolower($fkeys[0]->getForeignTableName()));
497
+        self::assertEquals(array('foreign_key_test'), array_map('strtolower', $fkeys[0]->getLocalColumns()));
498
+        self::assertEquals(array('id'), array_map('strtolower', $fkeys[0]->getForeignColumns()));
499
+        self::assertEquals('test_create_fk2', strtolower($fkeys[0]->getForeignTableName()));
500 500
 
501
-        if($fkeys[0]->hasOption('onDelete')) {
501
+        if ($fkeys[0]->hasOption('onDelete')) {
502 502
             self::assertEquals('CASCADE', $fkeys[0]->getOption('onDelete'));
503 503
         }
504 504
     }
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
 
519 519
     public function testAlterTableScenario()
520 520
     {
521
-        if(!$this->_sm->getDatabasePlatform()->supportsAlterTable()) {
521
+        if ( ! $this->_sm->getDatabasePlatform()->supportsAlterTable()) {
522 522
             $this->markTestSkipped('Alter Table is not supported by this platform.');
523 523
         }
524 524
 
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 
607 607
     public function testTableInNamespace()
608 608
     {
609
-        if (! $this->_sm->getDatabasePlatform()->supportsSchemas()) {
609
+        if ( ! $this->_sm->getDatabasePlatform()->supportsSchemas()) {
610 610
             $this->markTestSkipped('Schema definition is not supported by this platform.');
611 611
         }
612 612
 
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
 
631 631
     public function testCreateAndListViews()
632 632
     {
633
-        if (!$this->_sm->getDatabasePlatform()->supportsViews()) {
633
+        if ( ! $this->_sm->getDatabasePlatform()->supportsViews()) {
634 634
             $this->markTestSkipped('Views is not supported by this platform.');
635 635
         }
636 636
 
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
 
649 649
     public function testAutoincrementDetection()
650 650
     {
651
-        if (!$this->_sm->getDatabasePlatform()->supportsIdentityColumns()) {
651
+        if ( ! $this->_sm->getDatabasePlatform()->supportsIdentityColumns()) {
652 652
             $this->markTestSkipped('This test is only supported on platforms that have autoincrement');
653 653
         }
654 654
 
@@ -669,7 +669,7 @@  discard block
 block discarded – undo
669 669
      */
670 670
     public function testAutoincrementDetectionMulticolumns()
671 671
     {
672
-        if (!$this->_sm->getDatabasePlatform()->supportsIdentityColumns()) {
672
+        if ( ! $this->_sm->getDatabasePlatform()->supportsIdentityColumns()) {
673 673
             $this->markTestSkipped('This test is only supported on platforms that have autoincrement');
674 674
         }
675 675
 
@@ -691,7 +691,7 @@  discard block
 block discarded – undo
691 691
      */
692 692
     public function testUpdateSchemaWithForeignKeyRenaming()
693 693
     {
694
-        if (!$this->_sm->getDatabasePlatform()->supportsForeignKeyConstraints()) {
694
+        if ( ! $this->_sm->getDatabasePlatform()->supportsForeignKeyConstraints()) {
695 695
             $this->markTestSkipped('This test is only supported on platforms that have foreign keys.');
696 696
         }
697 697
 
@@ -736,7 +736,7 @@  discard block
 block discarded – undo
736 736
      */
737 737
     public function testRenameIndexUsedInForeignKeyConstraint()
738 738
     {
739
-        if (! $this->_sm->getDatabasePlatform()->supportsForeignKeyConstraints()) {
739
+        if ( ! $this->_sm->getDatabasePlatform()->supportsForeignKeyConstraints()) {
740 740
             $this->markTestSkipped('This test is only supported on platforms that have foreign keys.');
741 741
         }
742 742
 
@@ -940,7 +940,7 @@  discard block
 block discarded – undo
940 940
         return $table;
941 941
     }
942 942
 
943
-    protected function getTestTable($name, $options=array())
943
+    protected function getTestTable($name, $options = array())
944 944
     {
945 945
         $table = new Table($name, array(), array(), array(), false, $options);
946 946
         $table->setSchemaConfig($this->_sm->createSchemaConfig());
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
 
977 977
     public function testListForeignKeysComposite()
978 978
     {
979
-        if(!$this->_conn->getDatabasePlatform()->supportsForeignKeyConstraints()) {
979
+        if ( ! $this->_conn->getDatabasePlatform()->supportsForeignKeyConstraints()) {
980 980
             $this->markTestSkipped('Does not support foreign key constraints.');
981 981
         }
982 982
 
@@ -995,7 +995,7 @@  discard block
 block discarded – undo
995 995
 
996 996
         self::assertInstanceOf('Doctrine\DBAL\Schema\ForeignKeyConstraint', $fkeys[0]);
997 997
         self::assertEquals(array('id', 'foreign_key_test'), array_map('strtolower', $fkeys[0]->getLocalColumns()));
998
-        self::assertEquals(array('id', 'other_id'),         array_map('strtolower', $fkeys[0]->getForeignColumns()));
998
+        self::assertEquals(array('id', 'other_id'), array_map('strtolower', $fkeys[0]->getForeignColumns()));
999 999
     }
1000 1000
 
1001 1001
     /**
@@ -1224,7 +1224,7 @@  discard block
 block discarded – undo
1224 1224
      */
1225 1225
     public function testDoesNotListIndexesImplicitlyCreatedByForeignKeys()
1226 1226
     {
1227
-        if (! $this->_sm->getDatabasePlatform()->supportsForeignKeyConstraints()) {
1227
+        if ( ! $this->_sm->getDatabasePlatform()->supportsForeignKeyConstraints()) {
1228 1228
             $this->markTestSkipped('This test is only supported on platforms that have foreign keys.');
1229 1229
         }
1230 1230
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
         $paramInt = 1;
166 166
         $paramStr = 'foo';
167 167
 
168
-        $sql = "SELECT test_int, test_string FROM " . $this->_conn->quoteIdentifier($table) . " ".
168
+        $sql = "SELECT test_int, test_string FROM " . $this->_conn->quoteIdentifier($table) . " " .
169 169
                "WHERE test_int = " . $this->_conn->quote($paramInt) . " AND test_string = " . $this->_conn->quote($paramStr);
170 170
         $stmt = $this->_conn->prepare($sql);
171 171
         self::assertInstanceOf('Doctrine\DBAL\Statement', $stmt);
@@ -531,30 +531,30 @@  discard block
 block discarded – undo
531 531
     {
532 532
         $p = $this->_conn->getDatabasePlatform();
533 533
         $sql = 'SELECT ';
534
-        $sql .= $p->getDateDiffExpression('test_datetime', $p->getCurrentTimestampSQL()) .' AS diff, ';
535
-        $sql .= $p->getDateAddSecondsExpression('test_datetime', 1) .' AS add_seconds, ';
536
-        $sql .= $p->getDateSubSecondsExpression('test_datetime', 1) .' AS sub_seconds, ';
537
-        $sql .= $p->getDateAddMinutesExpression('test_datetime', 5) .' AS add_minutes, ';
538
-        $sql .= $p->getDateSubMinutesExpression('test_datetime', 5) .' AS sub_minutes, ';
539
-        $sql .= $p->getDateAddHourExpression('test_datetime', 3) .' AS add_hour, ';
540
-        $sql .= $p->getDateSubHourExpression('test_datetime', 3) .' AS sub_hour, ';
541
-        $sql .= $p->getDateAddDaysExpression('test_datetime', 10) .' AS add_days, ';
542
-        $sql .= $p->getDateSubDaysExpression('test_datetime', 10) .' AS sub_days, ';
543
-        $sql .= $p->getDateAddWeeksExpression('test_datetime', 1) .' AS add_weeks, ';
544
-        $sql .= $p->getDateSubWeeksExpression('test_datetime', 1) .' AS sub_weeks, ';
545
-        $sql .= $p->getDateAddMonthExpression('test_datetime', 2) .' AS add_month, ';
546
-        $sql .= $p->getDateSubMonthExpression('test_datetime', 2) .' AS sub_month, ';
547
-        $sql .= $p->getDateAddQuartersExpression('test_datetime', 3) .' AS add_quarters, ';
548
-        $sql .= $p->getDateSubQuartersExpression('test_datetime', 3) .' AS sub_quarters, ';
549
-        $sql .= $p->getDateAddYearsExpression('test_datetime', 6) .' AS add_years, ';
550
-        $sql .= $p->getDateSubYearsExpression('test_datetime', 6) .' AS sub_years ';
534
+        $sql .= $p->getDateDiffExpression('test_datetime', $p->getCurrentTimestampSQL()) . ' AS diff, ';
535
+        $sql .= $p->getDateAddSecondsExpression('test_datetime', 1) . ' AS add_seconds, ';
536
+        $sql .= $p->getDateSubSecondsExpression('test_datetime', 1) . ' AS sub_seconds, ';
537
+        $sql .= $p->getDateAddMinutesExpression('test_datetime', 5) . ' AS add_minutes, ';
538
+        $sql .= $p->getDateSubMinutesExpression('test_datetime', 5) . ' AS sub_minutes, ';
539
+        $sql .= $p->getDateAddHourExpression('test_datetime', 3) . ' AS add_hour, ';
540
+        $sql .= $p->getDateSubHourExpression('test_datetime', 3) . ' AS sub_hour, ';
541
+        $sql .= $p->getDateAddDaysExpression('test_datetime', 10) . ' AS add_days, ';
542
+        $sql .= $p->getDateSubDaysExpression('test_datetime', 10) . ' AS sub_days, ';
543
+        $sql .= $p->getDateAddWeeksExpression('test_datetime', 1) . ' AS add_weeks, ';
544
+        $sql .= $p->getDateSubWeeksExpression('test_datetime', 1) . ' AS sub_weeks, ';
545
+        $sql .= $p->getDateAddMonthExpression('test_datetime', 2) . ' AS add_month, ';
546
+        $sql .= $p->getDateSubMonthExpression('test_datetime', 2) . ' AS sub_month, ';
547
+        $sql .= $p->getDateAddQuartersExpression('test_datetime', 3) . ' AS add_quarters, ';
548
+        $sql .= $p->getDateSubQuartersExpression('test_datetime', 3) . ' AS sub_quarters, ';
549
+        $sql .= $p->getDateAddYearsExpression('test_datetime', 6) . ' AS add_years, ';
550
+        $sql .= $p->getDateSubYearsExpression('test_datetime', 6) . ' AS sub_years ';
551 551
         $sql .= 'FROM fetch_table';
552 552
 
553 553
         $row = $this->_conn->fetchAssoc($sql);
554 554
         $row = array_change_key_case($row, CASE_LOWER);
555 555
 
556 556
         $diff = (strtotime('2010-01-01') - strtotime(date('Y-m-d'))) / 3600 / 24;
557
-        self::assertEquals($diff, $row['diff'], "Date difference should be approx. ".$diff." days.", 1);
557
+        self::assertEquals($diff, $row['diff'], "Date difference should be approx. " . $diff . " days.", 1);
558 558
         self::assertEquals('2010-01-01 10:10:11', date('Y-m-d H:i:s', strtotime($row['add_seconds'])), "Adding second should end up on 2010-01-01 10:10:11");
559 559
         self::assertEquals('2010-01-01 10:10:09', date('Y-m-d H:i:s', strtotime($row['sub_seconds'])), "Subtracting second should end up on 2010-01-01 10:10:09");
560 560
         self::assertEquals('2010-01-01 10:15:10', date('Y-m-d H:i:s', strtotime($row['add_minutes'])), "Adding minutes should end up on 2010-01-01 10:15:10");
@@ -578,15 +578,15 @@  discard block
 block discarded – undo
578 578
         $platform = $this->_conn->getDatabasePlatform();
579 579
 
580 580
         $sql = 'SELECT ';
581
-        $sql .= $platform->getLocateExpression('test_string', "'oo'") .' AS locate1, ';
582
-        $sql .= $platform->getLocateExpression('test_string', "'foo'") .' AS locate2, ';
583
-        $sql .= $platform->getLocateExpression('test_string', "'bar'") .' AS locate3, ';
584
-        $sql .= $platform->getLocateExpression('test_string', 'test_string') .' AS locate4, ';
585
-        $sql .= $platform->getLocateExpression("'foo'", 'test_string') .' AS locate5, ';
586
-        $sql .= $platform->getLocateExpression("'barfoobaz'", 'test_string') .' AS locate6, ';
587
-        $sql .= $platform->getLocateExpression("'bar'", 'test_string') .' AS locate7, ';
588
-        $sql .= $platform->getLocateExpression('test_string', "'oo'", 2) .' AS locate8, ';
589
-        $sql .= $platform->getLocateExpression('test_string', "'oo'", 3) .' AS locate9 ';
581
+        $sql .= $platform->getLocateExpression('test_string', "'oo'") . ' AS locate1, ';
582
+        $sql .= $platform->getLocateExpression('test_string', "'foo'") . ' AS locate2, ';
583
+        $sql .= $platform->getLocateExpression('test_string', "'bar'") . ' AS locate3, ';
584
+        $sql .= $platform->getLocateExpression('test_string', 'test_string') . ' AS locate4, ';
585
+        $sql .= $platform->getLocateExpression("'foo'", 'test_string') . ' AS locate5, ';
586
+        $sql .= $platform->getLocateExpression("'barfoobaz'", 'test_string') . ' AS locate6, ';
587
+        $sql .= $platform->getLocateExpression("'bar'", 'test_string') . ' AS locate7, ';
588
+        $sql .= $platform->getLocateExpression('test_string', "'oo'", 2) . ' AS locate8, ';
589
+        $sql .= $platform->getLocateExpression('test_string', "'oo'", 3) . ' AS locate9 ';
590 590
         $sql .= 'FROM fetch_table';
591 591
 
592 592
         $row = $this->_conn->fetchAssoc($sql);
@@ -717,11 +717,11 @@  discard block
 block discarded – undo
717 717
 
718 718
         $results = $stmt->fetchAll(
719 719
             FetchMode::CUSTOM_OBJECT,
720
-            __NAMESPACE__.'\\MyFetchClass'
720
+            __NAMESPACE__ . '\\MyFetchClass'
721 721
         );
722 722
 
723 723
         self::assertCount(1, $results);
724
-        self::assertInstanceOf(__NAMESPACE__.'\\MyFetchClass', $results[0]);
724
+        self::assertInstanceOf(__NAMESPACE__ . '\\MyFetchClass', $results[0]);
725 725
 
726 726
         self::assertEquals(1, $results[0]->test_int);
727 727
         self::assertEquals('foo', $results[0]->test_string);
@@ -760,7 +760,7 @@  discard block
 block discarded – undo
760 760
         $results = $stmt->fetchAll();
761 761
 
762 762
         self::assertCount(1, $results);
763
-        self::assertInstanceOf(__NAMESPACE__.'\\MyFetchClass', $results[0]);
763
+        self::assertInstanceOf(__NAMESPACE__ . '\\MyFetchClass', $results[0]);
764 764
 
765 765
         self::assertEquals(1, $results[0]->test_int);
766 766
         self::assertEquals('foo', $results[0]->test_string);
@@ -785,7 +785,7 @@  discard block
 block discarded – undo
785 785
         }
786 786
 
787 787
         self::assertCount(1, $results);
788
-        self::assertInstanceOf(__NAMESPACE__.'\\MyFetchClass', $results[0]);
788
+        self::assertInstanceOf(__NAMESPACE__ . '\\MyFetchClass', $results[0]);
789 789
 
790 790
         self::assertEquals(1, $results[0]->test_int);
791 791
         self::assertEquals('foo', $results[0]->test_string);
@@ -885,7 +885,7 @@  discard block
 block discarded – undo
885 885
 
886 886
     private function skipOci8AndMysqli()
887 887
     {
888
-        if (isset($GLOBALS['db_type']) && $GLOBALS['db_type'] == "oci8")  {
888
+        if (isset($GLOBALS['db_type']) && $GLOBALS['db_type'] == "oci8") {
889 889
             $this->markTestSkipped("Not supported by OCI8");
890 890
         }
891 891
         if ('mysqli' == $this->_conn->getDriver()->getName()) {
Please login to merge, or discard this patch.
tests/Doctrine/Tests/DBAL/Functional/ModifyLimitQueryTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     {
17 17
         parent::setUp();
18 18
 
19
-        if (!self::$tableCreated) {
19
+        if ( ! self::$tableCreated) {
20 20
             /* @var $sm \Doctrine\DBAL\Schema\AbstractSchemaManager */
21 21
             $table = new \Doctrine\DBAL\Schema\Table("modify_limit_table");
22 22
             $table->addColumn('test_int', 'integer');
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
         $this->_conn->insert('modify_limit_table2', array('test_int' => 2));
96 96
 
97 97
         $sql = "SELECT modify_limit_table.test_int FROM modify_limit_table " .
98
-               "INNER JOIN modify_limit_table2 ON modify_limit_table.test_int = modify_limit_table2.test_int ".
98
+               "INNER JOIN modify_limit_table2 ON modify_limit_table.test_int = modify_limit_table2.test_int " .
99 99
                "GROUP BY modify_limit_table.test_int " .
100 100
                "ORDER BY modify_limit_table.test_int ASC";
101 101
         $this->assertLimitResult(array(1, 2), $sql, 10, 0);
Please login to merge, or discard this patch.
tests/Doctrine/Tests/DBAL/Functional/StatementTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -265,19 +265,19 @@
 block discarded – undo
265 265
     {
266 266
         return array(
267 267
             'fetch' => array(
268
-                function (Statement $stmt) {
268
+                function(Statement $stmt) {
269 269
                     return $stmt->fetch();
270 270
                 },
271 271
                 false,
272 272
             ),
273 273
             'fetch-column' => array(
274
-                function (Statement $stmt) {
274
+                function(Statement $stmt) {
275 275
                     return $stmt->fetchColumn();
276 276
                 },
277 277
                 false,
278 278
             ),
279 279
             'fetch-all' => array(
280
-                function (Statement $stmt) {
280
+                function(Statement $stmt) {
281 281
                     return $stmt->fetchAll();
282 282
                 },
283 283
                 array(),
Please login to merge, or discard this patch.
tests/Doctrine/Tests/DBAL/Functional/PortabilityTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         $portabilityMode = ConnectionPortability::PORTABILITY_ALL,
38 38
         $case = ColumnCase::LOWER
39 39
     ) {
40
-        if (!$this->portableConnection) {
40
+        if ( ! $this->portableConnection) {
41 41
             $params = $this->_conn->getParams();
42 42
 
43 43
             $params['wrapperClass'] = ConnectionPortability::class;
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
                 $this->portableConnection->insert('portability_table', array('Test_Int' => 1, 'Test_String' => 'foo', 'Test_Null' => ''));
61 61
                 $this->portableConnection->insert('portability_table', array('Test_Int' => 2, 'Test_String' => 'foo  ', 'Test_Null' => null));
62
-            } catch(\Exception $e) {
62
+            } catch (\Exception $e) {
63 63
 
64 64
             }
65 65
         }
Please login to merge, or discard this patch.
tests/Doctrine/Tests/DBAL/Functional/ConnectionTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 
67 67
     public function testTransactionNestingBehaviorWithSavepoints()
68 68
     {
69
-        if (!$this->_conn->getDatabasePlatform()->supportsSavepoints()) {
69
+        if ( ! $this->_conn->getDatabasePlatform()->supportsSavepoints()) {
70 70
             $this->markTestSkipped('This test requires the platform to support savepoints.');
71 71
         }
72 72
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 
106 106
     public function testTransactionNestingBehaviorCantBeChangedInActiveTransaction()
107 107
     {
108
-        if (!$this->_conn->getDatabasePlatform()->supportsSavepoints()) {
108
+        if ( ! $this->_conn->getDatabasePlatform()->supportsSavepoints()) {
109 109
             $this->markTestSkipped('This test requires the platform to support savepoints.');
110 110
         }
111 111
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/DBAL/DriverManagerTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@
 block discarded – undo
141 141
         $options = is_array($url) ? $url : ['url' => $url];
142 142
 
143 143
         if (isset($options['pdo'])) {
144
-            if (! extension_loaded('pdo')) {
144
+            if ( ! extension_loaded('pdo')) {
145 145
                 $this->markTestSkipped('PDO is not installed');
146 146
             }
147 147
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/DBAL/Schema/MySqlInheritCharsetTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace Doctrine\Tests\DBAL\Schema;
6 6
 
Please login to merge, or discard this patch.
tests/Doctrine/Tests/DBAL/Schema/ComparatorTest.php 1 patch
Spacing   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -46,76 +46,76 @@  discard block
 block discarded – undo
46 46
 {
47 47
     public function testCompareSame1()
48 48
     {
49
-        $schema1 = new Schema( array(
49
+        $schema1 = new Schema(array(
50 50
             'bugdb' => new Table('bugdb',
51
-                array (
52
-                    'integerfield1' => new Column('integerfield1', Type::getType('integer' ) ),
51
+                array(
52
+                    'integerfield1' => new Column('integerfield1', Type::getType('integer')),
53 53
                 )
54 54
             ),
55
-        ) );
56
-        $schema2 = new Schema( array(
55
+        ));
56
+        $schema2 = new Schema(array(
57 57
             'bugdb' => new Table('bugdb',
58
-                array (
59
-                    'integerfield1' => new Column('integerfield1', Type::getType('integer') ),
58
+                array(
59
+                    'integerfield1' => new Column('integerfield1', Type::getType('integer')),
60 60
                 )
61 61
             ),
62
-        ) );
62
+        ));
63 63
 
64 64
         $expected = new SchemaDiff();
65 65
         $expected->fromSchema = $schema1;
66
-        self::assertEquals($expected, Comparator::compareSchemas( $schema1, $schema2 ) );
66
+        self::assertEquals($expected, Comparator::compareSchemas($schema1, $schema2));
67 67
     }
68 68
 
69 69
     public function testCompareSame2()
70 70
     {
71
-        $schema1 = new Schema( array(
71
+        $schema1 = new Schema(array(
72 72
             'bugdb' => new Table('bugdb',
73
-                array (
73
+                array(
74 74
                     'integerfield1' => new Column('integerfield1', Type::getType('integer')),
75 75
                     'integerfield2' => new Column('integerfield2', Type::getType('integer')),
76 76
                 )
77 77
             ),
78
-        ) );
79
-        $schema2 = new Schema( array(
78
+        ));
79
+        $schema2 = new Schema(array(
80 80
             'bugdb' => new Table('bugdb',
81
-                array (
81
+                array(
82 82
                     'integerfield2' => new Column('integerfield2', Type::getType('integer')),
83 83
                     'integerfield1' => new Column('integerfield1', Type::getType('integer')),
84 84
                 )
85 85
             ),
86
-        ) );
86
+        ));
87 87
 
88 88
         $expected = new SchemaDiff();
89 89
         $expected->fromSchema = $schema1;
90
-        self::assertEquals($expected, Comparator::compareSchemas( $schema1, $schema2 ) );
90
+        self::assertEquals($expected, Comparator::compareSchemas($schema1, $schema2));
91 91
     }
92 92
 
93 93
     public function testCompareMissingTable()
94 94
     {
95 95
         $schemaConfig = new \Doctrine\DBAL\Schema\SchemaConfig;
96
-        $table = new Table('bugdb', array ('integerfield1' => new Column('integerfield1', Type::getType('integer'))));
96
+        $table = new Table('bugdb', array('integerfield1' => new Column('integerfield1', Type::getType('integer'))));
97 97
         $table->setSchemaConfig($schemaConfig);
98 98
 
99
-        $schema1 = new Schema( array($table), array(), $schemaConfig );
100
-        $schema2 = new Schema( array(),       array(), $schemaConfig );
99
+        $schema1 = new Schema(array($table), array(), $schemaConfig);
100
+        $schema2 = new Schema(array(), array(), $schemaConfig);
101 101
 
102
-        $expected = new SchemaDiff( array(), array(), array('bugdb' => $table), $schema1 );
102
+        $expected = new SchemaDiff(array(), array(), array('bugdb' => $table), $schema1);
103 103
 
104
-        self::assertEquals($expected, Comparator::compareSchemas( $schema1, $schema2 ) );
104
+        self::assertEquals($expected, Comparator::compareSchemas($schema1, $schema2));
105 105
     }
106 106
 
107 107
     public function testCompareNewTable()
108 108
     {
109 109
         $schemaConfig = new \Doctrine\DBAL\Schema\SchemaConfig;
110
-        $table = new Table('bugdb', array ('integerfield1' => new Column('integerfield1', Type::getType('integer'))));
110
+        $table = new Table('bugdb', array('integerfield1' => new Column('integerfield1', Type::getType('integer'))));
111 111
         $table->setSchemaConfig($schemaConfig);
112 112
 
113
-        $schema1 = new Schema( array(),       array(), $schemaConfig );
114
-        $schema2 = new Schema( array($table), array(), $schemaConfig );
113
+        $schema1 = new Schema(array(), array(), $schemaConfig);
114
+        $schema2 = new Schema(array($table), array(), $schemaConfig);
115 115
 
116
-        $expected = new SchemaDiff( array('bugdb' => $table), array(), array(), $schema1 );
116
+        $expected = new SchemaDiff(array('bugdb' => $table), array(), array(), $schema1);
117 117
 
118
-        self::assertEquals($expected, Comparator::compareSchemas( $schema1, $schema2 ) );
118
+        self::assertEquals($expected, Comparator::compareSchemas($schema1, $schema2));
119 119
     }
120 120
 
121 121
     public function testCompareOnlyAutoincrementChanged()
@@ -132,26 +132,26 @@  discard block
 block discarded – undo
132 132
     public function testCompareMissingField()
133 133
     {
134 134
         $missingColumn = new Column('integerfield1', Type::getType('integer'));
135
-        $schema1 = new Schema( array(
135
+        $schema1 = new Schema(array(
136 136
             'bugdb' => new Table('bugdb',
137
-                array (
137
+                array(
138 138
                     'integerfield1' => $missingColumn,
139 139
                     'integerfield2' => new Column('integerfield2', Type::getType('integer')),
140 140
                 )
141 141
             ),
142
-        ) );
143
-        $schema2 = new Schema( array(
142
+        ));
143
+        $schema2 = new Schema(array(
144 144
             'bugdb' => new Table('bugdb',
145
-                array (
145
+                array(
146 146
                     'integerfield2' => new Column('integerfield2', Type::getType('integer')),
147 147
                 )
148 148
             ),
149
-        ) );
149
+        ));
150 150
 
151
-        $expected = new SchemaDiff ( array(),
152
-            array (
153
-                'bugdb' => new TableDiff( 'bugdb', array(), array(),
154
-                    array (
151
+        $expected = new SchemaDiff(array(),
152
+            array(
153
+                'bugdb' => new TableDiff('bugdb', array(), array(),
154
+                    array(
155 155
                         'integerfield1' => $missingColumn,
156 156
                     )
157 157
                 )
@@ -160,31 +160,31 @@  discard block
 block discarded – undo
160 160
         $expected->fromSchema = $schema1;
161 161
         $expected->changedTables['bugdb']->fromTable = $schema1->getTable('bugdb');
162 162
 
163
-        self::assertEquals($expected, Comparator::compareSchemas( $schema1, $schema2 ) );
163
+        self::assertEquals($expected, Comparator::compareSchemas($schema1, $schema2));
164 164
     }
165 165
 
166 166
     public function testCompareNewField()
167 167
     {
168
-        $schema1 = new Schema( array(
168
+        $schema1 = new Schema(array(
169 169
             'bugdb' => new Table('bugdb',
170
-                array (
170
+                array(
171 171
                     'integerfield1' => new Column('integerfield1', Type::getType('integer')),
172 172
                 )
173 173
             ),
174
-        ) );
175
-        $schema2 = new Schema( array(
174
+        ));
175
+        $schema2 = new Schema(array(
176 176
             'bugdb' => new Table('bugdb',
177
-                array (
177
+                array(
178 178
                     'integerfield1' => new Column('integerfield1', Type::getType('integer')),
179 179
                     'integerfield2' => new Column('integerfield2', Type::getType('integer')),
180 180
                 )
181 181
             ),
182
-        ) );
182
+        ));
183 183
 
184
-        $expected = new SchemaDiff ( array(),
185
-            array (
186
-                'bugdb' => new TableDiff ('bugdb',
187
-                    array (
184
+        $expected = new SchemaDiff(array(),
185
+            array(
186
+                'bugdb' => new TableDiff('bugdb',
187
+                    array(
188 188
                         'integerfield2' => new Column('integerfield2', Type::getType('integer')),
189 189
                     )
190 190
                 ),
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
         $expected->fromSchema = $schema1;
194 194
         $expected->changedTables['bugdb']->fromTable = $schema1->getTable('bugdb');
195 195
 
196
-        self::assertEquals($expected, Comparator::compareSchemas( $schema1, $schema2 ) );
196
+        self::assertEquals($expected, Comparator::compareSchemas($schema1, $schema2));
197 197
     }
198 198
 
199 199
     public function testCompareChangedColumns_ChangeType()
@@ -244,13 +244,13 @@  discard block
 block discarded – undo
244 244
 
245 245
     public function testCompareRemovedIndex()
246 246
     {
247
-        $schema1 = new Schema( array(
247
+        $schema1 = new Schema(array(
248 248
             'bugdb' => new Table('bugdb',
249
-                array (
249
+                array(
250 250
                     'integerfield1' => new Column('integerfield1', Type::getType('integer')),
251 251
                     'integerfield2' => new Column('integerfield2', Type::getType('integer')),
252 252
                 ),
253
-                array (
253
+                array(
254 254
                     'primary' => new Index('primary',
255 255
                         array(
256 256
                             'integerfield1'
@@ -259,20 +259,20 @@  discard block
 block discarded – undo
259 259
                     )
260 260
                 )
261 261
             ),
262
-        ) );
263
-        $schema2 = new Schema( array(
262
+        ));
263
+        $schema2 = new Schema(array(
264 264
             'bugdb' => new Table('bugdb',
265
-                array (
265
+                array(
266 266
                     'integerfield1' => new Column('integerfield1', Type::getType('integer')),
267 267
                     'integerfield2' => new Column('integerfield2', Type::getType('integer')),
268 268
                 )
269 269
             ),
270
-        ) );
270
+        ));
271 271
 
272
-        $expected = new SchemaDiff ( array(),
273
-            array (
274
-                'bugdb' => new TableDiff( 'bugdb', array(), array(), array(), array(), array(),
275
-                    array (
272
+        $expected = new SchemaDiff(array(),
273
+            array(
274
+                'bugdb' => new TableDiff('bugdb', array(), array(), array(), array(), array(),
275
+                    array(
276 276
                         'primary' => new Index('primary',
277 277
                         array(
278 278
                             'integerfield1'
@@ -286,26 +286,26 @@  discard block
 block discarded – undo
286 286
         $expected->fromSchema = $schema1;
287 287
         $expected->changedTables['bugdb']->fromTable = $schema1->getTable('bugdb');
288 288
 
289
-        self::assertEquals($expected, Comparator::compareSchemas( $schema1, $schema2 ) );
289
+        self::assertEquals($expected, Comparator::compareSchemas($schema1, $schema2));
290 290
     }
291 291
 
292 292
     public function testCompareNewIndex()
293 293
     {
294
-        $schema1 = new Schema( array(
294
+        $schema1 = new Schema(array(
295 295
             'bugdb' => new Table('bugdb',
296
-                array (
296
+                array(
297 297
                     'integerfield1' => new Column('integerfield1', Type::getType('integer')),
298 298
                     'integerfield2' => new Column('integerfield2', Type::getType('integer')),
299 299
                 )
300 300
             ),
301
-        ) );
302
-        $schema2 = new Schema( array(
301
+        ));
302
+        $schema2 = new Schema(array(
303 303
             'bugdb' => new Table('bugdb',
304
-                array (
304
+                array(
305 305
                     'integerfield1' => new Column('integerfield1', Type::getType('integer')),
306 306
                     'integerfield2' => new Column('integerfield2', Type::getType('integer')),
307 307
                 ),
308
-                array (
308
+                array(
309 309
                     'primary' => new Index('primary',
310 310
                         array(
311 311
                             'integerfield1'
@@ -314,12 +314,12 @@  discard block
 block discarded – undo
314 314
                     )
315 315
                 )
316 316
             ),
317
-        ) );
317
+        ));
318 318
 
319
-        $expected = new SchemaDiff ( array(),
320
-            array (
321
-                'bugdb' => new TableDiff( 'bugdb', array(), array(), array(),
322
-                    array (
319
+        $expected = new SchemaDiff(array(),
320
+            array(
321
+                'bugdb' => new TableDiff('bugdb', array(), array(), array(),
322
+                    array(
323 323
                         'primary' => new Index('primary',
324 324
                             array(
325 325
                                 'integerfield1'
@@ -333,18 +333,18 @@  discard block
 block discarded – undo
333 333
         $expected->fromSchema = $schema1;
334 334
         $expected->changedTables['bugdb']->fromTable = $schema1->getTable('bugdb');
335 335
 
336
-        self::assertEquals($expected, Comparator::compareSchemas( $schema1, $schema2 ) );
336
+        self::assertEquals($expected, Comparator::compareSchemas($schema1, $schema2));
337 337
     }
338 338
 
339 339
     public function testCompareChangedIndex()
340 340
     {
341
-        $schema1 = new Schema( array(
341
+        $schema1 = new Schema(array(
342 342
             'bugdb' => new Table('bugdb',
343
-                array (
343
+                array(
344 344
                     'integerfield1' => new Column('integerfield1', Type::getType('integer')),
345 345
                     'integerfield2' => new Column('integerfield2', Type::getType('integer')),
346 346
                 ),
347
-                array (
347
+                array(
348 348
                     'primary' => new Index('primary',
349 349
                         array(
350 350
                             'integerfield1'
@@ -353,26 +353,26 @@  discard block
 block discarded – undo
353 353
                     )
354 354
                 )
355 355
             ),
356
-        ) );
357
-        $schema2 = new Schema( array(
356
+        ));
357
+        $schema2 = new Schema(array(
358 358
             'bugdb' => new Table('bugdb',
359
-                array (
359
+                array(
360 360
                     'integerfield1' => new Column('integerfield1', Type::getType('integer')),
361 361
                     'integerfield2' => new Column('integerfield2', Type::getType('integer')),
362 362
                 ),
363
-                array (
363
+                array(
364 364
                     'primary' => new Index('primary',
365 365
                         array('integerfield1', 'integerfield2'),
366 366
                         true
367 367
                     )
368 368
                 )
369 369
             ),
370
-        ) );
370
+        ));
371 371
 
372
-        $expected = new SchemaDiff ( array(),
373
-            array (
374
-                'bugdb' => new TableDiff( 'bugdb', array(), array(), array(), array(),
375
-                    array (
372
+        $expected = new SchemaDiff(array(),
373
+            array(
374
+                'bugdb' => new TableDiff('bugdb', array(), array(), array(), array(),
375
+                    array(
376 376
                         'primary' => new Index('primary',
377 377
                             array(
378 378
                                 'integerfield1',
@@ -387,38 +387,38 @@  discard block
 block discarded – undo
387 387
         $expected->fromSchema = $schema1;
388 388
         $expected->changedTables['bugdb']->fromTable = $schema1->getTable('bugdb');
389 389
 
390
-        self::assertEquals($expected, Comparator::compareSchemas( $schema1, $schema2 ));
390
+        self::assertEquals($expected, Comparator::compareSchemas($schema1, $schema2));
391 391
     }
392 392
 
393 393
     public function testCompareChangedIndexFieldPositions()
394 394
     {
395
-        $schema1 = new Schema( array(
395
+        $schema1 = new Schema(array(
396 396
             'bugdb' => new Table('bugdb',
397
-                array (
397
+                array(
398 398
                     'integerfield1' => new Column('integerfield1', Type::getType('integer')),
399 399
                     'integerfield2' => new Column('integerfield2', Type::getType('integer')),
400 400
                 ),
401
-                array (
401
+                array(
402 402
                     'primary' => new Index('primary', array('integerfield1', 'integerfield2'), true)
403 403
                 )
404 404
             ),
405
-        ) );
406
-        $schema2 = new Schema( array(
405
+        ));
406
+        $schema2 = new Schema(array(
407 407
             'bugdb' => new Table('bugdb',
408
-                array (
408
+                array(
409 409
                     'integerfield1' => new Column('integerfield1', Type::getType('integer')),
410 410
                     'integerfield2' => new Column('integerfield2', Type::getType('integer')),
411 411
                 ),
412
-                array (
412
+                array(
413 413
                     'primary' => new Index('primary', array('integerfield2', 'integerfield1'), true)
414 414
                 )
415 415
             ),
416
-        ) );
416
+        ));
417 417
 
418
-        $expected = new SchemaDiff ( array(),
419
-            array (
418
+        $expected = new SchemaDiff(array(),
419
+            array(
420 420
                 'bugdb' => new TableDiff('bugdb', array(), array(), array(), array(),
421
-                    array (
421
+                    array(
422 422
                         'primary' => new Index('primary', array('integerfield2', 'integerfield1'), true)
423 423
                     )
424 424
                 ),
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
         $expected->fromSchema = $schema1;
428 428
         $expected->changedTables['bugdb']->fromTable = $schema1->getTable('bugdb');
429 429
 
430
-        self::assertEquals($expected, Comparator::compareSchemas( $schema1, $schema2 ));
430
+        self::assertEquals($expected, Comparator::compareSchemas($schema1, $schema2));
431 431
     }
432 432
 
433 433
     public function testCompareSequences()
@@ -821,7 +821,7 @@  discard block
 block discarded – undo
821 821
         $c = new \Doctrine\DBAL\Schema\Comparator;
822 822
         $diff = $c->compare($schema, $schemaNew);
823 823
 
824
-        self::assertSame($diff->changedSequences[0] , $schemaNew->getSequence('baz'));
824
+        self::assertSame($diff->changedSequences[0], $schemaNew->getSequence('baz'));
825 825
     }
826 826
 
827 827
     /**
@@ -849,7 +849,7 @@  discard block
 block discarded – undo
849 849
         $oldSchema = new Schema(array(), array(), $config);
850 850
         $oldSchema->createTable('bar');
851 851
 
852
-        $newSchema= new Schema(array(), array(), $config);
852
+        $newSchema = new Schema(array(), array(), $config);
853 853
         $newSchema->createTable('foo.bar');
854 854
 
855 855
         $expected = new SchemaDiff();
@@ -870,7 +870,7 @@  discard block
 block discarded – undo
870 870
         $oldSchema->createTable('taz');
871 871
         $oldSchema->createTable('war.tab');
872 872
 
873
-        $newSchema= new Schema(array(), array(), $config);
873
+        $newSchema = new Schema(array(), array(), $config);
874 874
         $newSchema->createTable('bar.tab');
875 875
         $newSchema->createTable('baz.tab');
876 876
         $newSchema->createTable('war.tab');
@@ -1072,7 +1072,7 @@  discard block
 block discarded – undo
1072 1072
      * @param int        $changeTableCount
1073 1073
      * @param int        $removeTableCount
1074 1074
      */
1075
-    public function assertSchemaTableChangeCount($diff, $newTableCount=0, $changeTableCount=0, $removeTableCount=0)
1075
+    public function assertSchemaTableChangeCount($diff, $newTableCount = 0, $changeTableCount = 0, $removeTableCount = 0)
1076 1076
     {
1077 1077
         self::assertCount($newTableCount, $diff->newTables);
1078 1078
         self::assertCount($changeTableCount, $diff->changedTables);
@@ -1085,7 +1085,7 @@  discard block
 block discarded – undo
1085 1085
      * @param int        $changeSequenceCount
1086 1086
      * @param int        $changeSequenceCount
1087 1087
      */
1088
-    public function assertSchemaSequenceChangeCount($diff, $newSequenceCount=0, $changeSequenceCount=0, $removeSequenceCount=0)
1088
+    public function assertSchemaSequenceChangeCount($diff, $newSequenceCount = 0, $changeSequenceCount = 0, $removeSequenceCount = 0)
1089 1089
     {
1090 1090
         self::assertCount($newSequenceCount, $diff->newSequences, "Expected number of new sequences is wrong.");
1091 1091
         self::assertCount($changeSequenceCount, $diff->changedSequences, "Expected number of changed sequences is wrong.");
@@ -1240,7 +1240,7 @@  discard block
 block discarded – undo
1240 1240
 
1241 1241
     public function testForeignKeyRemovalWithRenamedLocalColumn()
1242 1242
     {
1243
-        $fromSchema = new Schema( array(
1243
+        $fromSchema = new Schema(array(
1244 1244
             'table1' => new Table('table1',
1245 1245
                 array(
1246 1246
                     'id' => new Column('id', Type::getType('integer')),
@@ -1255,7 +1255,7 @@  discard block
 block discarded – undo
1255 1255
                     new ForeignKeyConstraint(array('id_table1'), 'table1', array('id'), 'fk_table2_table1')
1256 1256
                 ))
1257 1257
         ));
1258
-        $toSchema = new Schema( array(
1258
+        $toSchema = new Schema(array(
1259 1259
             'table2' => new Table('table2',
1260 1260
                 array(
1261 1261
                     'id' => new Column('id', Type::getType('integer')),
Please login to merge, or discard this patch.