Example #1
0
 private function assertIterable($iterable, $throwable = null)
 {
     $throwable = ThrowableUtilities::validateAndNormalizeThrowable($throwable, new Exception\InvalidArgumentException(sprintf('Argument must be an array or implement Traversable; [%s] provided', is_object($iterable) ? get_class($iterable) : gettype($iterable))));
     if (!is_array($iterable) && !$iterable instanceof Traversable) {
         throw $throwable;
     }
 }
 /**
  * @expectedException \Klever\Heimdall\Exception\InvalidArgumentException
  */
 public function testValidateAndNormalizeThrowsExceptionOnInvalidThrowable()
 {
     ThrowableUtilities::validateAndNormalizeThrowable('INVALID', new CustomException());
 }