Skip to content
Permalink
Browse files

Changed the test to better cover the use-case in question

  • Loading branch information...
davidyell committed Oct 26, 2018
1 parent 64f8f0f commit 185b12cc2d7b20577740ae24398c53f971b7c293
Showing with 8 additions and 19 deletions.
  1. +8 −19 tests/TestCase/ORM/ResultSetTest.php
@@ -419,32 +419,21 @@ public function testIsEmptyDoesNotConsumeData()
}
/**
* Test that ResultSet implements the CollectionInterface min method
* Test that ResultSet
*
* @return void
*/
public function testCollectionMin()
public function testCollectionMinAndMax()
{
$query = $this->table->find('all');
$result = $query->min('id');
$expected = $this->table->get(1);
$min = $query->min('id');
$minExpected = $this->table->get(1);
$this->assertEquals($expected, $result);
}
/**
* Test that ResultSet implements the CollectionInterface max method
*
* @return void
*/
public function testCollectionMax()
{
$query = $this->table->find('all');
$result = $query->max('id');
$expected = $this->table->get(3);
$max = $query->max('id');
$maxExpected = $this->table->get(3);
$this->assertEquals($expected, $result);
$this->assertEquals($minExpected, $min);
$this->assertEquals($maxExpected, $max);
}
}

0 comments on commit 185b12c

Please sign in to comment.
You can’t perform that action at this time.