@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | public function testCannotEstablishConnection() |
133 | 133 | { |
134 | 134 | $options = $this->options; |
135 | - $options["dbhost"] = 'myserver'; // this server does not exists |
|
135 | + $options["dbhost"] = 'myserver'; // this server does not exists |
|
136 | 136 | |
137 | 137 | $conn = new MySQL($options); |
138 | 138 | |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | $this->assertEquals(2, $conn->getNumFields()); |
260 | 260 | $this->assertEquals(0, $conn->getRowsAffected()); |
261 | 261 | |
262 | - $rowset = $conn->getArrayResult(); # array with results |
|
262 | + $rowset = $conn->getArrayResult(); # array with results |
|
263 | 263 | $row = array_shift($rowset); |
264 | 264 | |
265 | 265 | $this->assertArrayHasKey("ID", $row); |
@@ -286,12 +286,12 @@ discard block |
||
286 | 286 | $conn->execute($sql); |
287 | 287 | $rowcount = count($conn->getArrayResult()); |
288 | 288 | |
289 | - $this->assertTrue(($rowcount === 1)); # the row is available for now |
|
289 | + $this->assertTrue(($rowcount === 1)); # the row is available for now |
|
290 | 290 | |
291 | 291 | # properties modified by execute() method |
292 | 292 | $this->assertEquals(1, $conn->getNumRows()); |
293 | 293 | $this->assertEquals(2, $conn->getNumFields()); |
294 | - $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false) |
|
294 | + $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false) |
|
295 | 295 | |
296 | 296 | $this->assertTrue($conn->commit()); |
297 | 297 | |
@@ -300,7 +300,7 @@ discard block |
||
300 | 300 | $conn->execute($sql); |
301 | 301 | $rowcount = count($conn->getArrayResult()); |
302 | 302 | |
303 | - $this->assertTrue(($rowcount === 1)); # the row is available |
|
303 | + $this->assertTrue(($rowcount === 1)); # the row is available |
|
304 | 304 | } |
305 | 305 | |
306 | 306 | /** |
@@ -323,12 +323,12 @@ discard block |
||
323 | 323 | $conn->execute($sql); |
324 | 324 | $rowcount = count($conn->getArrayResult()); |
325 | 325 | |
326 | - $this->assertTrue(($rowcount === 1)); # the row is available for now |
|
326 | + $this->assertTrue(($rowcount === 1)); # the row is available for now |
|
327 | 327 | |
328 | 328 | # properties modified by execute() method |
329 | 329 | $this->assertEquals(1, $conn->getNumRows()); |
330 | 330 | $this->assertEquals(2, $conn->getNumFields()); |
331 | - $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false) |
|
331 | + $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false) |
|
332 | 332 | |
333 | 333 | $this->assertTrue($conn->rollback()); |
334 | 334 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | $conn->execute($sql); |
338 | 338 | $rowcount = count($conn->getArrayResult()); |
339 | 339 | |
340 | - $this->assertNotTrue(($rowcount === 1)); # the row is not available |
|
340 | + $this->assertNotTrue(($rowcount === 1)); # the row is not available |
|
341 | 341 | } |
342 | 342 | |
343 | 343 | /** |
@@ -369,12 +369,12 @@ discard block |
||
369 | 369 | $conn->execute($sql); |
370 | 370 | $rowcount = count($conn->getArrayResult()); |
371 | 371 | |
372 | - $this->assertTrue(($rowcount === 4)); # the rows are available for now |
|
372 | + $this->assertTrue(($rowcount === 4)); # the rows are available for now |
|
373 | 373 | |
374 | 374 | # properties modified by execute() method |
375 | 375 | $this->assertEquals(4, $conn->getNumRows()); |
376 | 376 | $this->assertEquals(2, $conn->getNumFields()); |
377 | - $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false) |
|
377 | + $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false) |
|
378 | 378 | |
379 | 379 | $this->assertTrue($conn->commit()); |
380 | 380 | |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | $conn->execute($sql); |
384 | 384 | $rowcount = count($conn->getArrayResult()); |
385 | 385 | |
386 | - $this->assertTrue(($rowcount === 4)); # the rows are available |
|
386 | + $this->assertTrue(($rowcount === 4)); # the rows are available |
|
387 | 387 | } |
388 | 388 | |
389 | 389 | /** |
@@ -415,12 +415,12 @@ discard block |
||
415 | 415 | $conn->execute($sql); |
416 | 416 | $rowcount = count($conn->getArrayResult()); |
417 | 417 | |
418 | - $this->assertTrue(($rowcount === 4)); # the rows are available for now |
|
418 | + $this->assertTrue(($rowcount === 4)); # the rows are available for now |
|
419 | 419 | |
420 | 420 | # properties modified by execute() method |
421 | 421 | $this->assertEquals(4, $conn->getNumRows()); |
422 | 422 | $this->assertEquals(2, $conn->getNumFields()); |
423 | - $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false) |
|
423 | + $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false) |
|
424 | 424 | |
425 | 425 | $this->assertTrue($conn->rollback()); |
426 | 426 | |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | $conn->execute($sql); |
430 | 430 | $rowcount = count($conn->getArrayResult()); |
431 | 431 | |
432 | - $this->assertNotTrue(($rowcount === 4)); # the rows are not available |
|
432 | + $this->assertNotTrue(($rowcount === 4)); # the rows are not available |
|
433 | 433 | $this->assertTrue(($rowcount === 0)); |
434 | 434 | } |
435 | 435 | |
@@ -461,12 +461,12 @@ discard block |
||
461 | 461 | $conn->execute($sql); |
462 | 462 | $rowcount = count($conn->getArrayResult()); |
463 | 463 | |
464 | - $this->assertTrue(($rowcount === 2)); # the rows are available for now |
|
464 | + $this->assertTrue(($rowcount === 2)); # the rows are available for now |
|
465 | 465 | |
466 | 466 | # properties modified by execute() method |
467 | 467 | $this->assertEquals(2, $conn->getNumRows()); |
468 | 468 | $this->assertEquals(2, $conn->getNumFields()); |
469 | - $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false) |
|
469 | + $this->assertEquals(0, $conn->getRowsAffected()); # nothing affected (autocommit = false) |
|
470 | 470 | |
471 | 471 | # ends the transaction |
472 | 472 | $conn->endTransaction(); |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | $conn->execute($sql); |
477 | 477 | $rowcount = count($conn->getArrayResult()); |
478 | 478 | |
479 | - $this->assertTrue(($rowcount === 2)); # the row is available |
|
479 | + $this->assertTrue(($rowcount === 2)); # the row is available |
|
480 | 480 | } |
481 | 481 | |
482 | 482 | /** |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | $conn->execute($sql); |
504 | 504 | |
505 | 505 | $sql = "INSERT INTO MYTABLE (DESCRIPTION, WRONG) VALUES ('TRANS_SHORTCUT_2')"; |
506 | - $conn->execute($sql); # this throws the exception |
|
506 | + $conn->execute($sql); # this throws the exception |
|
507 | 507 | } |
508 | 508 | catch (InvalidQueryException $e) |
509 | 509 | { |
@@ -519,7 +519,7 @@ discard block |
||
519 | 519 | $conn->execute($sql); |
520 | 520 | $rowcount = count($conn->getArrayResult()); |
521 | 521 | |
522 | - $this->assertNotTrue(($rowcount === 0)); # the rows are not available |
|
522 | + $this->assertNotTrue(($rowcount === 0)); # the rows are not available |
|
523 | 523 | |
524 | 524 | # remove all work |
525 | 525 | $conn->execute("DROP TABLE MYTABLE"); |
@@ -81,8 +81,7 @@ discard block |
||
81 | 81 | |
82 | 82 | try { |
83 | 83 | $conn->disconnect(); |
84 | - } |
|
85 | - catch (\Exception $e) |
|
84 | + } catch (\Exception $e) |
|
86 | 85 | { |
87 | 86 | $this->assertNotTrue($conn->isConnected()); |
88 | 87 | throw $e; |
@@ -116,8 +115,7 @@ discard block |
||
116 | 115 | |
117 | 116 | try { |
118 | 117 | $conn->reconnect(); |
119 | - } |
|
120 | - catch (\Exception $e) |
|
118 | + } catch (\Exception $e) |
|
121 | 119 | { |
122 | 120 | $this->assertNotTrue($conn->isConnected()); |
123 | 121 | throw $e; |
@@ -139,8 +137,7 @@ discard block |
||
139 | 137 | try |
140 | 138 | { |
141 | 139 | $conn->connect(); |
142 | - } |
|
143 | - catch (\Exception $e) |
|
140 | + } catch (\Exception $e) |
|
144 | 141 | { |
145 | 142 | $this->assertNotTrue($conn->isConnected()); |
146 | 143 | throw $e; |
@@ -504,8 +501,7 @@ discard block |
||
504 | 501 | |
505 | 502 | $sql = "INSERT INTO MYTABLE (DESCRIPTION, WRONG) VALUES ('TRANS_SHORTCUT_2')"; |
506 | 503 | $conn->execute($sql); # this throws the exception |
507 | - } |
|
508 | - catch (InvalidQueryException $e) |
|
504 | + } catch (InvalidQueryException $e) |
|
509 | 505 | { |
510 | 506 | #·not necessary! |
511 | 507 | # $this->assertTrue($conn->rollback()); |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | public function testCannotEstablishConnectionWhenExists() |
67 | 67 | { |
68 | 68 | $options = $this->options; |
69 | - $options["dbhost"] = 'myserver'; // this server does not exists |
|
69 | + $options["dbhost"] = 'myserver'; // this server does not exists |
|
70 | 70 | |
71 | 71 | $entity = new MyEntity(); |
72 | 72 | new TableGateway($entity, ["default" => $options]); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | public function testCannotEstablishConnection() |
81 | 81 | { |
82 | 82 | $options = $this->options; |
83 | - $options["dbhost"] = 'myserver'; // this server does not exists |
|
83 | + $options["dbhost"] = 'myserver'; // this server does not exists |
|
84 | 84 | |
85 | 85 | $entity = new MyEntity(); |
86 | 86 | $gateway = new TableGateway($entity, ["other" => $options]); |
@@ -88,8 +88,7 @@ |
||
88 | 88 | try |
89 | 89 | { |
90 | 90 | $gateway->getDb()->connect(); |
91 | - } |
|
92 | - catch (\Exception $e) |
|
91 | + } catch (\Exception $e) |
|
93 | 92 | { |
94 | 93 | $this->assertNotTrue($gateway->getDb()->isConnected()); |
95 | 94 | throw $e; |