Add AuthenticationServiceProvider

This commit is contained in:
Romain Neutron
2013-02-15 11:08:05 +01:00
parent f5c5aebe22
commit d2bc4f4a23
117 changed files with 610 additions and 535 deletions

View File

@@ -465,21 +465,21 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract
$stmt = self::$DI['app']['phraseanet.appbox']->get_connection()->prepare($sql);
foreach ($bases as $base_id) {
$stmt->execute(array(':usr_id' => self::$DI['app']['phraseanet.user']->get_id(), ':base_id' => $base_id));
$stmt->execute(array(':usr_id' => self::$DI['app']['authentication']->getUser()->get_id(), ':base_id' => $base_id));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$this->assertEquals(1, $row['actif']);
$this->assertTrue(self::$DI['user']->ACL()->has_access_to_base($base_id));
self::$DI['user']->ACL()->update_rights_to_base($base_id, array('actif' => false));
$stmt->execute(array(':usr_id' => self::$DI['app']['phraseanet.user']->get_id(), ':base_id' => $base_id));
$stmt->execute(array(':usr_id' => self::$DI['app']['authentication']->getUser()->get_id(), ':base_id' => $base_id));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$this->assertEquals(0, $row['actif']);
$this->assertFalse(self::$DI['user']->ACL()->has_access_to_base($base_id));
self::$DI['user']->ACL()->update_rights_to_base($base_id, array('actif' => true));
$stmt->execute(array(':usr_id' => self::$DI['app']['phraseanet.user']->get_id(), ':base_id' => $base_id));
$stmt->execute(array(':usr_id' => self::$DI['app']['authentication']->getUser()->get_id(), ':base_id' => $base_id));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$this->assertEquals(1, $row['actif']);