@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | $conn = $this->object->acquire(); |
208 | 208 | |
209 | 209 | $value = "(\\')"; |
210 | - $sqlinsert = str_replace( ':value', '\'' . $conn->escape( $value ) . '\'', $sqlinsert ); |
|
210 | + $sqlinsert = str_replace( ':value', '\''.$conn->escape( $value ).'\'', $sqlinsert ); |
|
211 | 211 | $stmt = $conn->create( $sqlinsert ); |
212 | 212 | $stmt->execute()->finish(); |
213 | 213 | |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | { |
222 | 222 | $conn = $this->object->acquire(); |
223 | 223 | |
224 | - $sqlinsert = 'INSERT INTO "mw_unit_test" ("name") VALUES (\'' . $conn->escape( '\'\'' ) . '\')'; |
|
224 | + $sqlinsert = 'INSERT INTO "mw_unit_test" ("name") VALUES (\''.$conn->escape( '\'\'' ).'\')'; |
|
225 | 225 | |
226 | 226 | $stmt = $conn->create( $sqlinsert ); |
227 | 227 | $stmt->execute()->finish(); |
@@ -248,12 +248,12 @@ discard block |
||
248 | 248 | |
249 | 249 | public function testStmtSimpleBindTwo() |
250 | 250 | { |
251 | - $sqlinsert2 = 'INSERT INTO "mw_unit_test" ("id", "name") VALUES (?, ?)'; |
|
251 | + $sqlinsert2 = 'INSERT INTO "mw_unit_test" ("id", "name") VALUES (?, ?)'; |
|
252 | 252 | |
253 | 253 | $conn = $this->object->acquire(); |
254 | 254 | |
255 | 255 | $stmt2 = $conn->create( $sqlinsert2 ); |
256 | - $stmt2->bind( 1, 1, \Aimeos\MW\DB\Statement\Base::PARAM_INT); |
|
256 | + $stmt2->bind( 1, 1, \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
|
257 | 257 | $stmt2->bind( 2, 0.12 ); |
258 | 258 | $stmt2->execute()->finish(); |
259 | 259 | |
@@ -265,12 +265,12 @@ discard block |
||
265 | 265 | |
266 | 266 | public function testStmtSimpleBindThree() |
267 | 267 | { |
268 | - $sqlinsert3 = 'INSERT INTO "mw_unit_test" ("name", "id") VALUES (\'?te?st?\', ?)'; |
|
268 | + $sqlinsert3 = 'INSERT INTO "mw_unit_test" ("name", "id") VALUES (\'?te?st?\', ?)'; |
|
269 | 269 | |
270 | 270 | $conn = $this->object->acquire(); |
271 | 271 | |
272 | 272 | $stmt2 = $conn->create( $sqlinsert3 ); |
273 | - $stmt2->bind( 1, 1, \Aimeos\MW\DB\Statement\Base::PARAM_INT); |
|
273 | + $stmt2->bind( 1, 1, \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
|
274 | 274 | $stmt2->execute()->finish(); |
275 | 275 | |
276 | 276 | $this->object->release( $conn ); |
@@ -281,15 +281,15 @@ discard block |
||
281 | 281 | |
282 | 282 | public function testStmtSimpleInvalidBindParamType() |
283 | 283 | { |
284 | - $sqlinsert2 = 'INSERT INTO "mw_unit_test" ("id", "name") VALUES (?, ?)'; |
|
284 | + $sqlinsert2 = 'INSERT INTO "mw_unit_test" ("id", "name") VALUES (?, ?)'; |
|
285 | 285 | |
286 | 286 | $conn = $this->object->acquire(); |
287 | 287 | |
288 | 288 | try |
289 | 289 | { |
290 | 290 | $stmt2 = $conn->create( $sqlinsert2 ); |
291 | - $stmt2->bind( 1, 1, \Aimeos\MW\DB\Statement\Base::PARAM_INT); |
|
292 | - $stmt2->bind( 2, 0.15, 123); |
|
291 | + $stmt2->bind( 1, 1, \Aimeos\MW\DB\Statement\Base::PARAM_INT ); |
|
292 | + $stmt2->bind( 2, 0.15, 123 ); |
|
293 | 293 | $stmt2->execute(); |
294 | 294 | } |
295 | 295 | catch( \Aimeos\MW\DB\Exception $de ) |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | } |
300 | 300 | |
301 | 301 | $this->object->release( $conn ); |
302 | - $this->fail('An expected exception has not been raised'); |
|
302 | + $this->fail( 'An expected exception has not been raised' ); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | |
@@ -312,13 +312,13 @@ discard block |
||
312 | 312 | try { |
313 | 313 | $stmt = $conn->create( $sqlinsert ); |
314 | 314 | $stmt->execute(); |
315 | - } catch ( \Aimeos\MW\DB\Exception $de ) { |
|
315 | + } catch( \Aimeos\MW\DB\Exception $de ) { |
|
316 | 316 | $this->object->release( $conn ); |
317 | 317 | return; |
318 | 318 | } |
319 | 319 | |
320 | 320 | $this->object->release( $conn ); |
321 | - $this->fail('An expected exception has not been raised'); |
|
321 | + $this->fail( 'An expected exception has not been raised' ); |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | |
422 | 422 | public function testWrongFieldType() |
423 | 423 | { |
424 | - $this->setExpectedException('\\Aimeos\\MW\\DB\\Exception'); |
|
424 | + $this->setExpectedException( '\\Aimeos\\MW\\DB\\Exception' ); |
|
425 | 425 | $sqlinsert = 'INSERT INTO "mw_unit_test" ("id", "name") VALUES (?, ?)'; |
426 | 426 | |
427 | 427 | $conn = $this->object->acquire(); |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | $stmt->bind( 2, 'test', 123 ); |
434 | 434 | $stmt->execute(); |
435 | 435 | } |
436 | - catch ( \Aimeos\MW\DB\Exception $e ) |
|
436 | + catch( \Aimeos\MW\DB\Exception $e ) |
|
437 | 437 | { |
438 | 438 | $this->object->release( $conn ); |
439 | 439 | throw $e; |
@@ -457,13 +457,13 @@ discard block |
||
457 | 457 | |
458 | 458 | $conn = $this->object->acquire(); |
459 | 459 | |
460 | - $this->setExpectedException('\\Aimeos\\MW\\DB\\Exception'); |
|
460 | + $this->setExpectedException( '\\Aimeos\\MW\\DB\\Exception' ); |
|
461 | 461 | |
462 | 462 | try |
463 | 463 | { |
464 | 464 | $conn->create( $sql )->execute()->finish(); |
465 | 465 | } |
466 | - catch ( \Aimeos\MW\DB\Exception $e ) |
|
466 | + catch( \Aimeos\MW\DB\Exception $e ) |
|
467 | 467 | { |
468 | 468 | $this->object->release( $conn ); |
469 | 469 | throw $e; |
@@ -475,13 +475,13 @@ discard block |
||
475 | 475 | { |
476 | 476 | $conn = $this->object->acquire(); |
477 | 477 | |
478 | - $this->setExpectedException('\\Aimeos\\MW\\DB\\Exception'); |
|
478 | + $this->setExpectedException( '\\Aimeos\\MW\\DB\\Exception' ); |
|
479 | 479 | |
480 | 480 | try |
481 | 481 | { |
482 | 482 | $conn->create( 'SELECT *' )->execute()->finish(); |
483 | 483 | } |
484 | - catch ( \Aimeos\MW\DB\Exception $e ) |
|
484 | + catch( \Aimeos\MW\DB\Exception $e ) |
|
485 | 485 | { |
486 | 486 | $this->object->release( $conn ); |
487 | 487 | throw $e; |
@@ -495,13 +495,13 @@ discard block |
||
495 | 495 | |
496 | 496 | $conn = $this->object->acquire(); |
497 | 497 | |
498 | - $this->setExpectedException('\\Aimeos\\MW\\DB\\Exception'); |
|
498 | + $this->setExpectedException( '\\Aimeos\\MW\\DB\\Exception' ); |
|
499 | 499 | |
500 | 500 | try |
501 | 501 | { |
502 | 502 | $conn->create( $sql, 123 ); |
503 | 503 | } |
504 | - catch (\Aimeos\MW\DB\Exception $e) |
|
504 | + catch( \Aimeos\MW\DB\Exception $e ) |
|
505 | 505 | { |
506 | 506 | $this->object->release( $conn ); |
507 | 507 | throw $e; |
@@ -513,20 +513,20 @@ discard block |
||
513 | 513 | { |
514 | 514 | $mock = $this->getMockBuilder( '\Aimeos\MW\DB\Connection\Iface' )->getMock(); |
515 | 515 | |
516 | - $this->setExpectedException('\\Aimeos\\MW\\DB\\Exception'); |
|
516 | + $this->setExpectedException( '\\Aimeos\\MW\\DB\\Exception' ); |
|
517 | 517 | $this->object->release( $mock ); |
518 | 518 | } |
519 | 519 | |
520 | 520 | |
521 | 521 | public function testDBFactory() |
522 | 522 | { |
523 | - $this->assertInstanceOf('\\Aimeos\\MW\\DB\\Manager\\Iface', $this->object); |
|
523 | + $this->assertInstanceOf( '\\Aimeos\\MW\\DB\\Manager\\Iface', $this->object ); |
|
524 | 524 | } |
525 | 525 | |
526 | 526 | |
527 | 527 | public function testFactoryFail() |
528 | 528 | { |
529 | - $this->setExpectedException('\\Aimeos\\MW\\DB\\Exception'); |
|
529 | + $this->setExpectedException( '\\Aimeos\\MW\\DB\\Exception' ); |
|
530 | 530 | \Aimeos\MW\DB\Factory::createManager( \TestHelperMw::getConfig(), 'notDefined' ); |
531 | 531 | } |
532 | 532 | } |