Skip to content
Permalink
Browse files

Added a test case with an aggregate field

  • Loading branch information...
davidyell committed Oct 26, 2018
1 parent 185b12c commit a89441d3c03acf0556d234601af0b767f23a4731
Showing with 17 additions and 0 deletions.
  1. +17 −0 tests/TestCase/ORM/ResultSetTest.php
@@ -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.
You can’t perform that action at this time.