mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
Merge branch '3.8'
Conflicts: tests/Alchemy/Tests/Phrasea/Application/OverviewTest.php
This commit is contained in:
@@ -207,21 +207,25 @@ class AuthenticatorTest extends \PhraseanetPHPUnitAbstract
|
||||
*/
|
||||
public function testCloseAccount()
|
||||
{
|
||||
$app = new Application();
|
||||
|
||||
$app = self::$DI['app'];
|
||||
$user = self::$DI['user'];
|
||||
|
||||
$app['browser'] = $browser = $this->getBrowserMock();
|
||||
$app['session'] = $session = $this->getSessionMock();
|
||||
$app['EM'] = $em = $this->getEntityManagerMock();
|
||||
|
||||
$session->set('usr_id', $user->get_id());
|
||||
|
||||
$authenticator = new Authenticator($app, $browser, $session, $em);
|
||||
$authenticator = new Authenticator($app, $app['browser'], $app['session'], $app['EM']);
|
||||
$authenticator->openAccount($user);
|
||||
$this->assertNotNull($authenticator->getUser());
|
||||
$authenticator->closeAccount();
|
||||
$this->assertNull($authenticator->getUser());
|
||||
}
|
||||
|
||||
public function testCloseAccountWhenNoSessionThrowsAnException()
|
||||
{
|
||||
$app = self::$DI['app'];
|
||||
|
||||
$authenticator = new Authenticator($app, $app['browser'], $app['session'], $app['EM']);
|
||||
$this->setExpectedException('Alchemy\Phrasea\Exception\RuntimeException', 'No session to close.');
|
||||
$authenticator->closeAccount();
|
||||
}
|
||||
|
||||
/**
|
||||
* @covers Alchemy\Phrasea\Authentication\Authenticator::isAuthenticated
|
||||
*/
|
||||
|
Reference in New Issue
Block a user