@@ -263,11 +263,10 @@ discard block |
||
| 263 | 263 | { |
| 264 | 264 | foreach ($this->routes as $key => $route) |
| 265 | 265 | { |
| 266 | - if |
|
| 267 | - ( |
|
| 268 | - $route["module"] == $this->identifiers["module"] && |
|
| 266 | + if ( |
|
| 267 | + $route["module"] == $this->identifiers["module"] && |
|
| 269 | 268 | $route["controller"] == $this->identifiers["controller"] && |
| 270 | - $route["view"] == $this->identifiers["view"] |
|
| 269 | + $route["view"] == $this->identifiers["view"] |
|
| 271 | 270 | ) |
| 272 | 271 | { |
| 273 | 272 | $module = $route["module"]; |
@@ -282,9 +281,8 @@ discard block |
||
| 282 | 281 | |
| 283 | 282 | if (count($this->defaults) && !$match) |
| 284 | 283 | { |
| 285 | - if |
|
| 286 | - ( |
|
| 287 | - !empty($this->defaults["module"]) && |
|
| 284 | + if ( |
|
| 285 | + !empty($this->defaults["module"]) && |
|
| 288 | 286 | !empty($this->defaults["controller"]) && |
| 289 | 287 | !empty($this->defaults["view"]) |
| 290 | 288 | ) |
@@ -190,17 +190,17 @@ |
||
| 190 | 190 | */ |
| 191 | 191 | public function run() |
| 192 | 192 | { |
| 193 | - $module = isset($_GET["module"]) ? $_GET["module"] : null; |
|
| 193 | + $module = isset($_GET["module"]) ? $_GET["module"] : null; |
|
| 194 | 194 | $controller = isset($_GET["controller"]) ? $_GET["controller"] : null; |
| 195 | - $view = isset($_GET["view"]) ? $_GET["view"] : null; |
|
| 195 | + $view = isset($_GET["view"]) ? $_GET["view"] : null; |
|
| 196 | 196 | |
| 197 | 197 | $request = new \Zend\Http\Request(); |
| 198 | 198 | |
| 199 | 199 | # build URI |
| 200 | 200 | $uri = ''; |
| 201 | - $uri .= !empty($module) ? '/' . $module : ""; |
|
| 201 | + $uri .= !empty($module) ? '/' . $module : ""; |
|
| 202 | 202 | $uri .= !empty($controller) ? '/' . $controller : ""; |
| 203 | - $uri .= !empty($view) ? '/' . $view : ""; |
|
| 203 | + $uri .= !empty($view) ? '/' . $view : ""; |
|
| 204 | 204 | |
| 205 | 205 | if (empty($uri)) |
| 206 | 206 | $uri = "/"; |
@@ -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"); |
@@ -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]); |