mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge branch '3.5' into 3
This commit is contained in:
commit
4d3cd9d9a2
@ -30,7 +30,6 @@ class SQLQueryTest extends SapphireTest {
|
||||
|
||||
//basic counting
|
||||
$qry = SQLQueryTest_DO::get()->dataQuery()->getFinalisedQuery();
|
||||
$qry->setGroupBy('"Common"');
|
||||
$ids = $this->allFixtureIDs('SQLQueryTest_DO');
|
||||
|
||||
$count = $qry->count('"SQLQueryTest_DO"."ID"');
|
||||
@ -39,6 +38,11 @@ class SQLQueryTest extends SapphireTest {
|
||||
|
||||
//test with `having`
|
||||
if (DB::get_conn() instanceof MySQLDatabase) {
|
||||
$qry->setSelect(array(
|
||||
'Date' => 'MAX("Date")',
|
||||
'Common' => '"Common"',
|
||||
));
|
||||
$qry->setGroupBy('"Common"');
|
||||
$qry->setHaving('"Date" > 2012-02-01');
|
||||
$count = $qry->count('"SQLQueryTest_DO"."ID"');
|
||||
$this->assertEquals(1, $count);
|
||||
|
Loading…
Reference in New Issue
Block a user