Skip to content

Commit

Permalink
Merge branch 'Setitch-3.x' into 3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
akrabat committed Jul 26, 2016
2 parents 049de06 + 7234b5a commit 3bd204e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Slim/CallableResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ public function resolve($toResolve)
}

if (!is_callable($resolved)) {
throw new RuntimeException(sprintf('%s is not resolvable', $toResolve));
throw new RuntimeException(sprintf('%s is not resolvable', is_array($toResolve) || is_object($toResolve) ? json_encode($toResolve) : $toResolve));
}

return $resolved;
}
}
7 changes: 7 additions & 0 deletions tests/CallableResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,11 @@ public function testClassNotFoundThrowException()
$this->setExpectedException('\RuntimeException', 'Callable Unknown does not exist');
$resolver->resolve('Unknown:notFound');
}

public function testCallableClassNotFoundThrowException()
{
$resolver = new CallableResolver($this->container);
$this->setExpectedException('\RuntimeException', 'is not resolvable');
$resolver->resolve(['Unknown', 'notFound']);
}
}

0 comments on commit 3bd204e

Please sign in to comment.