Skip to content

Commit

Permalink
Improve error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
mnapoli committed Sep 17, 2015
1 parent 0b59dae commit 7b2d2cd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Invoker.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private function resolveCallableFromContainer($callable)
return $this->container->get($callable);
} else {
throw new NotCallableException(sprintf(
'%s is neither a callable nor a valid container entry',
'"%s" is neither a callable nor a valid container entry',
$callable
));
}
Expand Down
13 changes: 12 additions & 1 deletion tests/InvokerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,18 @@ public function should_throw_if_calling_non_callable_without_container()
/**
* @test
* @expectedException \Invoker\Exception\NotCallableException
* @expectedExceptionMessage foo is neither a callable nor a valid container entry
* @expectedExceptionMessage NULL is not a callable
*/
public function should_throw_if_calling_non_callable_without_container_2()
{
$invoker = new Invoker();
$invoker->call(null);
}

/**
* @test
* @expectedException \Invoker\Exception\NotCallableException
* @expectedExceptionMessage "foo" is neither a callable nor a valid container entry
*/
public function should_throw_if_calling_non_callable_with_container()
{
Expand Down

0 comments on commit 7b2d2cd

Please sign in to comment.