mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
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
This commit is contained in:
parent
780ea68f2f
commit
9563541814
@ -111,13 +111,17 @@ class ManagerTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @expectedException \Exception
|
|
||||||
**/
|
**/
|
||||||
public function testWriteSessionTwice()
|
public function testWriteSessionTwice()
|
||||||
{
|
{
|
||||||
$auth = $this->getManagerInstance($session, false);
|
$exception = false;
|
||||||
$this->assertFalse($auth->isAuthenticated(true));
|
try {
|
||||||
$auth->authenticate(new Credentials("jdoe", "passjdoe"));
|
$auth = $this->getManagerInstance($session, false);
|
||||||
|
$this->assertFalse($auth->isAuthenticated(true));
|
||||||
|
$auth->authenticate(new Credentials("jdoe", "passjdoe"));
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$exception = true;
|
||||||
|
}
|
||||||
|
$this->assertTrue($exception);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user