Skip to content

Commit

Permalink
Added some tests to ensure the helper functions throw exceptions at t…
Browse files Browse the repository at this point in the history
…he appropriate times - refs #47
  • Loading branch information
Luke Visinoni committed Jan 8, 2017
1 parent 80b736b commit 339132a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/FunctionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use ArrayIterator;
use Closure;
use Exception;
use InvalidArgumentException;
use function
Noz\collect,
Noz\invoke,
Expand Down Expand Up @@ -293,4 +294,20 @@ public function testNormalizeOffsetThrowsExceptionForInvalidOffset()
{
normalize_offset('chooochooo');
}

/**
* @expectedException InvalidArgumentException
*/
public function testNormalizeOffsetWillThrowExceptionIfPassedNegativeOffsetWithoutCount()
{
normalize_offset(-10, null);
}

/**
* @expectedException RuntimeException
*/
public function testGetCountThrowsExceptionOnInvalidInput()
{
normalize_offset('chooochooo');
}
}

0 comments on commit 339132a

Please sign in to comment.