Skip to content
Permalink
Browse files

split null tests

  • Loading branch information...
Iandenh committed Jul 27, 2017
1 parent 1593eaf commit 593bece4481c803711ef011533d3f66a9dcfda17
Showing with 20 additions and 4 deletions.
  1. +20 −4 tests/TestCase/Collection/CollectionTest.php
@@ -75,7 +75,7 @@ public function avgProvider()
}
/**
* ests the avg method
* Tests the avg method
*
* @dataProvider avgProvider
* @return void
@@ -85,14 +85,22 @@ public function testAvg($items)
$collection = new Collection($items);
$this->assertEquals(2, $collection->avg());
$collection = new Collection([]);
$this->assertNull($collection->avg());
$items = [['foo' => 1], ['foo' => 2], ['foo' => 3]];
$collection = new Collection($items);
$this->assertEquals(2, $collection->avg('foo'));
}
/**
* Tests the avg method when on an empty collection
*
* @return void
*/
public function testAvgWithEmptyCollection()
{
$collection = new Collection([]);
$this->assertNull($collection->avg());
}
/**
* Provider for average tests with use of a matcher
*
@@ -145,7 +153,15 @@ public function testMedian($items)
{
$collection = new Collection($items);
$this->assertEquals(4, $collection->median());
}
/**
* Tests the median method when on an empty collection
*
* @return void
*/
public function testMedianWithEmptyCollection()
{
$collection = new Collection([]);
$this->assertNull($collection->median());
}

0 comments on commit 593bece

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