From 510cd39c4ca159a12e6d89838440227af6c4a393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20N=C3=A9grier?= Date: Wed, 21 Jan 2015 16:47:25 +0100 Subject: [PATCH] Adding test for exceptions --- .travis.yml | 1 - tests/PicotainerTest.php | 11 +++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a48c668..a7d4ef2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,4 +15,3 @@ script: after_script: - php vendor/bin/coveralls -v - \ No newline at end of file diff --git a/tests/PicotainerTest.php b/tests/PicotainerTest.php index f2fbb42..e32e1a4 100644 --- a/tests/PicotainerTest.php +++ b/tests/PicotainerTest.php @@ -18,6 +18,17 @@ public function testGet() $this->assertEquals('value', $container->get('instance')); } + /** + * + * @expectedException Mouf\Picotainer\PicotainerNotFoundException + */ + public function testGetException() + { + $container = new Picotainer([]); + + $container->get('nonexistant'); + } + public function testDelegateContainer() { $container = new Picotainer([