|
|
@ -476,12 +476,13 @@ class QueryBuilderTest extends DatabaseTestCase |
|
|
|
'gsm.username as GSM', |
|
|
|
'gsm.username as GSM', |
|
|
|
'part.Part', |
|
|
|
'part.Part', |
|
|
|
'Part Cost' => 't.Part_Cost', |
|
|
|
'Part Cost' => 't.Part_Cost', |
|
|
|
|
|
|
|
'st_x(location::geometry) as lon', |
|
|
|
new Expression("case t.Status_Id when 1 then 'Acknowledge' when 2 then 'No Action' else 'Unknown Action' END as [[Next Action]]"), |
|
|
|
new Expression("case t.Status_Id when 1 then 'Acknowledge' when 2 then 'No Action' else 'Unknown Action' END as [[Next Action]]"), |
|
|
|
]) |
|
|
|
]) |
|
|
|
->from('tablename'); |
|
|
|
->from('tablename'); |
|
|
|
list ($sql, $params) = $this->getQueryBuilder()->build($query); |
|
|
|
list ($sql, $params) = $this->getQueryBuilder()->build($query); |
|
|
|
$expected = $this->replaceQuotes( |
|
|
|
$expected = $this->replaceQuotes( |
|
|
|
'SELECT `t`.`id` AS `ID`, `gsm`.`username` AS `GSM`, `part`.`Part`, `t`.`Part_Cost` AS `Part Cost`,' |
|
|
|
'SELECT `t`.`id` AS `ID`, `gsm`.`username` AS `GSM`, `part`.`Part`, `t`.`Part_Cost` AS `Part Cost`, st_x(location::geometry) as lon,' |
|
|
|
. ' case t.Status_Id when 1 then \'Acknowledge\' when 2 then \'No Action\' else \'Unknown Action\' END as [[Next Action]] FROM `tablename`'); |
|
|
|
. ' case t.Status_Id when 1 then \'Acknowledge\' when 2 then \'No Action\' else \'Unknown Action\' END as [[Next Action]] FROM `tablename`'); |
|
|
|
$this->assertEquals($expected, $sql); |
|
|
|
$this->assertEquals($expected, $sql); |
|
|
|
$this->assertEmpty($params); |
|
|
|
$this->assertEmpty($params); |
|
|
|