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

@@ -160,7 +160,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
public function testSearch_recordsWithRecords()
{
$auth = new \Session_Authentication_None(self::$DI['user']);
self::$DI['app']->openAccount($auth);
self::$DI['app']['authentication']->openAccount($auth);
$record = \record_adapter::createFromFile(BorderFile::buildFromPathfile(__DIR__ . '/../../../files/cestlafete.jpg', self::$DI['collection'], self::$DI['app']), self::$DI['app']);
@@ -241,7 +241,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
public function testSearch_recordsWithStories()
{
$auth = new \Session_Authentication_None(self::$DI['user']);
self::$DI['app']->openAccount($auth);
self::$DI['app']['authentication']->openAccount($auth);
$story = \record_adapter::createStory(self::$DI['app'], self::$DI['collection']);
@@ -274,7 +274,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
public function testSearchWithStories()
{
$auth = new \Session_Authentication_None(self::$DI['user']);
self::$DI['app']->openAccount($auth);
self::$DI['app']['authentication']->openAccount($auth);
$story = \record_adapter::createStory(self::$DI['app'], self::$DI['collection']);
@@ -310,7 +310,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
public function testSearchWithRecords()
{
$auth = new \Session_Authentication_None(self::$DI['user']);
self::$DI['app']->openAccount($auth);
self::$DI['app']['authentication']->openAccount($auth);
$record = \record_adapter::createFromFile(BorderFile::buildFromPathfile(__DIR__ . '/../../../files/cestlafete.jpg', self::$DI['collection'], self::$DI['app']), self::$DI['app']);
@@ -563,7 +563,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
$repo = $em->getRepository('\Entities\Basket');
/* @var $repo \Repositories\BasketRepository */
$basket = $repo->findUserBasket(self::$DI['app'], $response['response']['basket']['basket_id'], self::$DI['app']['phraseanet.user'], true);
$basket = $repo->findUserBasket(self::$DI['app'], $response['response']['basket']['basket_id'], self::$DI['app']['authentication']->getUser(), true);
$this->assertTrue($basket instanceof \Entities\Basket);
$em->remove($basket);
@@ -572,7 +572,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
public function testDelete_basket()
{
$usr_id = self::$DI['app']['phraseanet.user']->get_id();
$usr_id = self::$DI['app']['authentication']->getUser()->get_id();
$user = User_Adapter::getInstance($usr_id, self::$DI['app']);
$em = self::$DI['app']['EM'];
@@ -604,7 +604,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
public function testGet_basket()
{
$usr_id = self::$DI['app']['phraseanet.user']->get_id();
$usr_id = self::$DI['app']['authentication']->getUser()->get_id();
$basket = $this->insertOneBasket();
@@ -617,7 +617,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
public function testSet_basket_title()
{
$usr_id = self::$DI['app']['phraseanet.user']->get_id();
$usr_id = self::$DI['app']['authentication']->getUser()->get_id();
$basket = $this->insertOneBasket();
@@ -636,7 +636,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
public function testSet_basket_description()
{
$usr_id = self::$DI['app']['phraseanet.user']->get_id();
$usr_id = self::$DI['app']['authentication']->getUser()->get_id();
$basket = $this->insertOneBasket();