Passed
Branch tests-better-coverage (039fc0)
by Michael
09:41
created
tests/Doctrine/Tests/DBAL/Functional/Ticket/DBAL752Test.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
 
15 15
         $platform = $this->_conn->getDatabasePlatform()->getName();
16 16
 
17
-        if (!in_array($platform, array('sqlite'))) {
17
+        if ( ! in_array($platform, array('sqlite'))) {
18 18
             $this->markTestSkipped('Related to SQLite only');
19 19
         }
20 20
     }
Please login to merge, or discard this patch.
tests/Doctrine/Tests/DBAL/Functional/Schema/OracleSchemaManagerTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,13 +14,13 @@
 block discarded – undo
14 14
     {
15 15
         parent::setUp();
16 16
 
17
-        if(!isset($GLOBALS['db_username'])) {
17
+        if ( ! isset($GLOBALS['db_username'])) {
18 18
             $this->markTestSkipped('Foo');
19 19
         }
20 20
 
21 21
         $username = $GLOBALS['db_username'];
22 22
 
23
-        $query = "GRANT ALL PRIVILEGES TO ".$username;
23
+        $query = "GRANT ALL PRIVILEGES TO " . $username;
24 24
 
25 25
         $conn = \Doctrine\Tests\TestUtil::getTempConnection();
26 26
         $conn->executeUpdate($query);
Please login to merge, or discard this patch.
tests/Doctrine/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -456,17 +456,17 @@
 block discarded – undo
456 456
         $this->_conn->query('DROP TABLE IF EXISTS test_column_defaults_with_create');
457 457
 
458 458
         $escapeSequences = [
459
-            "\\0",          // An ASCII NUL (X'00') character
460
-            "\\'", "''",    // Single quote
461
-            '\\"', '""',    // Double quote
462
-            '\\b',          // A backspace character
463
-            '\\n',          // A new-line character
464
-            '\\r',          // A carriage return character
465
-            '\\t',          // A tab character
466
-            '\\Z',          // ASCII 26 (Control+Z)
467
-            '\\\\',         // A backslash (\) character
468
-            '\\%',          // A percent (%) character
469
-            '\\_',          // An underscore (_) character
459
+            "\\0", // An ASCII NUL (X'00') character
460
+            "\\'", "''", // Single quote
461
+            '\\"', '""', // Double quote
462
+            '\\b', // A backspace character
463
+            '\\n', // A new-line character
464
+            '\\r', // A carriage return character
465
+            '\\t', // A tab character
466
+            '\\Z', // ASCII 26 (Control+Z)
467
+            '\\\\', // A backslash (\) character
468
+            '\\%', // A percent (%) character
469
+            '\\_', // An underscore (_) character
470 470
         ];
471 471
 
472 472
         $default = implode('+', $escapeSequences);
Please login to merge, or discard this patch.
tests/Doctrine/Tests/DBAL/Functional/Schema/SqliteSchemaManagerTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 
24 24
     public function testCreateAndDropDatabase()
25 25
     {
26
-        $path = dirname(__FILE__).'/test_create_and_drop_sqlite_database.sqlite';
26
+        $path = dirname(__FILE__) . '/test_create_and_drop_sqlite_database.sqlite';
27 27
 
28 28
         $this->_sm->createDatabase($path);
29 29
         self::assertFileExists($path);
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         }
146 146
 
147 147
         $version = \SQLite3::version();
148
-        if(version_compare($version['versionString'], '3.7.16', '<')) {
148
+        if (version_compare($version['versionString'], '3.7.16', '<')) {
149 149
             $this->markTestSkipped('This version of sqlite doesn\'t return the order of the Primary Key.');
150 150
         }
151 151
         $this->_conn->exec(<<<EOS
Please login to merge, or discard this patch.
tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
     {
21 21
         parent::tearDown();
22 22
 
23
-        if (!$this->_conn) {
23
+        if ( ! $this->_conn) {
24 24
             return;
25 25
         }
26 26
 
@@ -219,22 +219,22 @@  discard block
 block discarded – undo
219 219
 
220 220
     public function testListForeignKeys()
221 221
     {
222
-        if(!$this->_conn->getDatabasePlatform()->supportsForeignKeyConstraints()) {
222
+        if ( ! $this->_conn->getDatabasePlatform()->supportsForeignKeyConstraints()) {
223 223
             $this->markTestSkipped('Does not support foreign key constraints.');
224 224
         }
225 225
 
226
-        $fkOptions = array('SET NULL', 'SET DEFAULT', 'NO ACTION','CASCADE', 'RESTRICT');
226
+        $fkOptions = array('SET NULL', 'SET DEFAULT', 'NO ACTION', 'CASCADE', 'RESTRICT');
227 227
         $foreignKeys = array();
228 228
         $fkTable = $this->getTestTable('test_create_fk1');
229
-        for($i = 0; $i < count($fkOptions); $i++) {
229
+        for ($i = 0; $i < count($fkOptions); $i++) {
230 230
             $fkTable->addColumn("foreign_key_test$i", 'integer');
231 231
             $foreignKeys[] = new \Doctrine\DBAL\Schema\ForeignKeyConstraint(
232
-                                 array("foreign_key_test$i"), 'test_create_fk2', array('id'), "foreign_key_test_$i"."_fk", array('onDelete' => $fkOptions[$i]));
232
+                                 array("foreign_key_test$i"), 'test_create_fk2', array('id'), "foreign_key_test_$i" . "_fk", array('onDelete' => $fkOptions[$i]));
233 233
         }
234 234
         $this->_sm->dropAndCreateTable($fkTable);
235 235
         $this->createTestTable('test_create_fk2');
236 236
 
237
-        foreach($foreignKeys as $foreignKey) {
237
+        foreach ($foreignKeys as $foreignKey) {
238 238
             $this->_sm->createForeignKey($foreignKey, 'test_create_fk1');
239 239
         }
240 240
         $fkeys = $this->_sm->listTableForeignKeys('test_create_fk1');
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
             self::assertEquals(array('id'), array_map('strtolower', $fkeys[$i]->getForeignColumns()));
245 245
             self::assertEquals('test_create_fk2', strtolower($fkeys[0]->getForeignTableName()));
246 246
             if ($foreignKeys[$i]->getOption('onDelete') == 'NO ACTION') {
247
-                self::assertFalse($fkeys[$i]->hasOption('onDelete'), 'Unexpected option: '. $fkeys[$i]->getOption('onDelete'));
247
+                self::assertFalse($fkeys[$i]->hasOption('onDelete'), 'Unexpected option: ' . $fkeys[$i]->getOption('onDelete'));
248 248
             } else {
249 249
                 self::assertEquals($foreignKeys[$i]->getOption('onDelete'), $fkeys[$i]->getOption('onDelete'));
250 250
             }
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
      */
379 379
     public function testJsonbColumn(string $type): void
380 380
     {
381
-        if (!$this->_sm->getDatabasePlatform() instanceof PostgreSQL94Platform) {
381
+        if ( ! $this->_sm->getDatabasePlatform() instanceof PostgreSQL94Platform) {
382 382
             $this->markTestSkipped("Requires PostgresSQL 9.4+");
383 383
             return;
384 384
         }
Please login to merge, or discard this patch.
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.