diff --git a/src/Invoker.php b/src/Invoker.php index 0c3d97d..b6005ce 100644 --- a/src/Invoker.php +++ b/src/Invoker.php @@ -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 )); } diff --git a/tests/InvokerTest.php b/tests/InvokerTest.php index 3915df4..eed781d 100644 --- a/tests/InvokerTest.php +++ b/tests/InvokerTest.php @@ -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() {