Skip to content

Commit

Permalink
Added a test case with an aggregate field
Browse files Browse the repository at this point in the history
  • Loading branch information
David Yell committed Oct 26, 2018
1 parent 185b12c commit a89441d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/TestCase/ORM/ResultSetTest.php
Expand Up @@ -436,4 +436,21 @@ public function testCollectionMinAndMax()
$this->assertEquals($minExpected, $min);
$this->assertEquals($maxExpected, $max);
}

/**
* Test that ResultSet
*
* @return void
*/
public function testCollectionMinAndMaxWithAggregateField()
{
$query = $this->table->find();
$query->select(['count' => 'length(title)']);

$min = $query->min('count');
$max = $query->max('count');

$this->assertEquals(13, $min->count);
$this->assertEquals(14, $max->count);
}
}

0 comments on commit a89441d

Please sign in to comment.