Merge branch '3.5' into 3

This commit is contained in:
Daniel Hensby 2017-02-08 10:40:40 +00:00
commit 4d3cd9d9a2
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E

View File

@ -30,7 +30,6 @@ class SQLQueryTest extends SapphireTest {
//basic counting //basic counting
$qry = SQLQueryTest_DO::get()->dataQuery()->getFinalisedQuery(); $qry = SQLQueryTest_DO::get()->dataQuery()->getFinalisedQuery();
$qry->setGroupBy('"Common"');
$ids = $this->allFixtureIDs('SQLQueryTest_DO'); $ids = $this->allFixtureIDs('SQLQueryTest_DO');
$count = $qry->count('"SQLQueryTest_DO"."ID"'); $count = $qry->count('"SQLQueryTest_DO"."ID"');
@ -39,6 +38,11 @@ class SQLQueryTest extends SapphireTest {
//test with `having` //test with `having`
if (DB::get_conn() instanceof MySQLDatabase) { if (DB::get_conn() instanceof MySQLDatabase) {
$qry->setSelect(array(
'Date' => 'MAX("Date")',
'Common' => '"Common"',
));
$qry->setGroupBy('"Common"');
$qry->setHaving('"Date" > 2012-02-01'); $qry->setHaving('"Date" > 2012-02-01');
$count = $qry->count('"SQLQueryTest_DO"."ID"'); $count = $qry->count('"SQLQueryTest_DO"."ID"');
$this->assertEquals(1, $count); $this->assertEquals(1, $count);