Browse Source

added test case for #8918

tags/2.0.6
Carsten Brandt 9 years ago
parent
commit
2872365000
  1. 3
      tests/framework/db/QueryBuilderTest.php

3
tests/framework/db/QueryBuilderTest.php

@ -476,12 +476,13 @@ class QueryBuilderTest extends DatabaseTestCase
'gsm.username as GSM',
'part.Part',
'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]]"),
])
->from('tablename');
list ($sql, $params) = $this->getQueryBuilder()->build($query);
$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`');
$this->assertEquals($expected, $sql);
$this->assertEmpty($params);

Loading…
Cancel
Save