Fix #1693 : Guest users should be able to access detailed view

This commit is contained in:
Romain Neutron
2014-02-10 14:08:01 +01:00
parent de6959f59f
commit 68e775dfd3
3 changed files with 58 additions and 9 deletions

View File

@@ -917,12 +917,14 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
return;
}
protected function authenticate(Application $app)
protected function authenticate(Application $app, $user = null)
{
$user = $user ?: self::$DI['user'];
$app['session']->clear();
$app['session']->set('usr_id', self::$DI['user']->get_id());
$app['session']->set('usr_id', $user->get_id());
$session = new \Entities\Session();
$session->setUsrId(self::$DI['user']->get_id());
$session->setUsrId($user->get_id());
$session->setUserAgent('');
self::$DI['app']['EM']->persist($session);
self::$DI['app']['EM']->flush();