From 95635418140e148848d3f47c11f14f9cc7d11387 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannis=20Mo=C3=9Fhammer?= Date: Fri, 14 Jun 2013 09:39:34 +0200 Subject: [PATCH] Fix ManagerTest's invaldi @expectedException annotation The annotation catched the generic \Exception, which PHPunit forbids. Now the tests directly catches and asserts this exception refs #4310 --- .../library/Icinga/Authentication/ManagerTest.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/test/php/library/Icinga/Authentication/ManagerTest.php b/test/php/library/Icinga/Authentication/ManagerTest.php index d03d9ea22..4b946c7f0 100644 --- a/test/php/library/Icinga/Authentication/ManagerTest.php +++ b/test/php/library/Icinga/Authentication/ManagerTest.php @@ -111,13 +111,17 @@ class ManagerTest extends \PHPUnit_Framework_TestCase /** * - * @expectedException \Exception **/ public function testWriteSessionTwice() { - $auth = $this->getManagerInstance($session, false); - $this->assertFalse($auth->isAuthenticated(true)); - $auth->authenticate(new Credentials("jdoe", "passjdoe")); - + $exception = false; + try { + $auth = $this->getManagerInstance($session, false); + $this->assertFalse($auth->isAuthenticated(true)); + $auth->authenticate(new Credentials("jdoe", "passjdoe")); + } catch (\Exception $e) { + $exception = true; + } + $this->assertTrue($exception); } }