Skip to content

Commit

Permalink
split null tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Iandenh committed Jul 27, 2017
1 parent 1593eaf commit 593bece
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions tests/TestCase/Collection/CollectionTest.php
Expand Up @@ -75,7 +75,7 @@ public function avgProvider()
}

/**
* ests the avg method
* Tests the avg method
*
* @dataProvider avgProvider
* @return void
Expand All @@ -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
*
Expand Down Expand Up @@ -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());
}
Expand Down

0 comments on commit 593bece

Please sign in to comment.