parent
3d62b8fda2
commit
6897db63a7
|
@ -5,6 +5,7 @@
|
|||
namespace Tests\Icinga\Session;
|
||||
|
||||
use \Exception;
|
||||
use \Mockery;
|
||||
use Icinga\Test\BaseTestCase;
|
||||
use Icinga\Web\Session\SessionNamespace;
|
||||
|
||||
|
@ -85,4 +86,26 @@ class SessionNamespaceTest extends BaseTestCase
|
|||
$this->assertEquals($value, $values[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Cannot save, session not set
|
||||
*/
|
||||
public function testInvalidParentWrite()
|
||||
{
|
||||
$ns = new SessionNamespace();
|
||||
$ns->write();
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether it is possible to write a namespace's parent
|
||||
*/
|
||||
public function testValidParentWrite()
|
||||
{
|
||||
$sessionMock = Mockery::mock('Icinga\Web\Session\Session');
|
||||
$sessionMock->shouldReceive('write')->atLeast()->times(1);
|
||||
|
||||
$ns = new SessionNamespace($sessionMock);
|
||||
$ns->write();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue