|
@@ 345-352 (lines=8) @@
|
| 342 |
|
self::assertEquals('SELECT u.*, p.* FROM users u ORDER BY u.name ASC, u.username DESC', (string) $qb); |
| 343 |
|
} |
| 344 |
|
|
| 345 |
|
public function testEmptySelect() |
| 346 |
|
{ |
| 347 |
|
$qb = new QueryBuilder($this->conn); |
| 348 |
|
$qb2 = $qb->select(); |
| 349 |
|
|
| 350 |
|
self::assertSame($qb, $qb2); |
| 351 |
|
self::assertEquals(QueryBuilder::SELECT, $qb->getType()); |
| 352 |
|
} |
| 353 |
|
|
| 354 |
|
public function testSelectAddSelect() |
| 355 |
|
{ |
|
@@ 366-373 (lines=8) @@
|
| 363 |
|
self::assertEquals('SELECT u.*, p.* FROM users u', (string) $qb); |
| 364 |
|
} |
| 365 |
|
|
| 366 |
|
public function testEmptyAddSelect() |
| 367 |
|
{ |
| 368 |
|
$qb = new QueryBuilder($this->conn); |
| 369 |
|
$qb2 = $qb->addSelect(); |
| 370 |
|
|
| 371 |
|
self::assertSame($qb, $qb2); |
| 372 |
|
self::assertEquals(QueryBuilder::SELECT, $qb->getType()); |
| 373 |
|
} |
| 374 |
|
|
| 375 |
|
public function testSelectMultipleFrom() |
| 376 |
|
{ |
|
@@ 419-426 (lines=8) @@
|
| 416 |
|
self::assertEquals('UPDATE users u SET u.foo = ? WHERE u.foo = ?', (string) $qb); |
| 417 |
|
} |
| 418 |
|
|
| 419 |
|
public function testEmptyUpdate() |
| 420 |
|
{ |
| 421 |
|
$qb = new QueryBuilder($this->conn); |
| 422 |
|
$qb2 = $qb->update(); |
| 423 |
|
|
| 424 |
|
self::assertEquals(QueryBuilder::UPDATE, $qb->getType()); |
| 425 |
|
self::assertSame($qb2, $qb); |
| 426 |
|
} |
| 427 |
|
|
| 428 |
|
public function testDelete() |
| 429 |
|
{ |
|
@@ 455-462 (lines=8) @@
|
| 452 |
|
self::assertEquals('DELETE FROM users u WHERE u.foo = ?', (string) $qb); |
| 453 |
|
} |
| 454 |
|
|
| 455 |
|
public function testEmptyDelete() |
| 456 |
|
{ |
| 457 |
|
$qb = new QueryBuilder($this->conn); |
| 458 |
|
$qb2 = $qb->delete(); |
| 459 |
|
|
| 460 |
|
self::assertEquals(QueryBuilder::DELETE, $qb->getType()); |
| 461 |
|
self::assertSame($qb2, $qb); |
| 462 |
|
} |
| 463 |
|
|
| 464 |
|
public function testInsertValues() |
| 465 |
|
{ |
|
@@ 527-534 (lines=8) @@
|
| 524 |
|
self::assertEquals('INSERT INTO users (foo, bar) VALUES(?, ?)', (string) $qb); |
| 525 |
|
} |
| 526 |
|
|
| 527 |
|
public function testEmptyInsert() |
| 528 |
|
{ |
| 529 |
|
$qb = new QueryBuilder($this->conn); |
| 530 |
|
$qb2 = $qb->insert(); |
| 531 |
|
|
| 532 |
|
self::assertEquals(QueryBuilder::INSERT, $qb->getType()); |
| 533 |
|
self::assertSame($qb2, $qb); |
| 534 |
|
} |
| 535 |
|
|
| 536 |
|
public function testGetConnection() |
| 537 |
|
{ |