|
@@ 110-119 (lines=10) @@
|
| 107 |
|
static::assertEquals("SELECT * FROM `table1` UNION SELECT * FROM `table2`", $union->assemble()); |
| 108 |
|
} |
| 109 |
|
|
| 110 |
|
public function testJoinTableName() |
| 111 |
|
{ |
| 112 |
|
$this->selectQuery->from("table1"); |
| 113 |
|
$this->selectQuery->join("table2", ['id', 'id_table1']); |
| 114 |
|
|
| 115 |
|
static::assertEquals( |
| 116 |
|
"SELECT * FROM `table1` JOIN `table2` ON `table1`.`id` = `table2`.`id_table1`", |
| 117 |
|
$this->selectQuery->assemble() |
| 118 |
|
); |
| 119 |
|
} |
| 120 |
|
|
| 121 |
|
public function testJoinTableNameWithAlias() |
| 122 |
|
{ |
|
@@ 121-130 (lines=10) @@
|
| 118 |
|
); |
| 119 |
|
} |
| 120 |
|
|
| 121 |
|
public function testJoinTableNameWithAlias() |
| 122 |
|
{ |
| 123 |
|
$this->selectQuery->from("table1"); |
| 124 |
|
$this->selectQuery->join(["table2", "alias"], ['id', 'id_table1']); |
| 125 |
|
|
| 126 |
|
static::assertEquals( |
| 127 |
|
"SELECT * FROM `table1` JOIN `table2` AS `alias` ON `table1`.`id` = `table2`.`id_table1`", |
| 128 |
|
$this->selectQuery->assemble() |
| 129 |
|
); |
| 130 |
|
} |
| 131 |
|
|
| 132 |
|
public function testJoinSubQuery() |
| 133 |
|
{ |