Merge branch '3.8'

Conflicts:
	tests/Alchemy/Tests/Phrasea/Application/OverviewTest.php
This commit is contained in:
Romain Neutron
2013-10-31 17:56:48 +01:00
22 changed files with 144 additions and 107 deletions

View File

@@ -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
*/