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

@@ -1113,6 +1113,14 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
{
$app['session']->clear();
$app['session']->set('usr_id', self::$DI['user']->get_id());
$session = new \Entities\Session();
$session->setUsrId(self::$DI['user']->get_id());
$session->setUserAgent('');
self::$DI['app']['EM']->persist($session);
self::$DI['app']['EM']->flush();
$app['session']->set('session_id', $session->getId());
self::$DI['app']['authentication']->reinitUser();
}

View File

@@ -17,7 +17,7 @@ class Session_LoggerTest extends PhraseanetPHPUnitAbstract
{
$user = self::$DI['user'];
self::$DI['app']['authentication']->openAccount(self::$DI['user']);
$this->authenticate(self::$DI['app']);
$logger_creater = self::$DI['app']['phraseanet.logger'];
foreach ($user->ACL()->get_granted_sbas() as $databox) {
@@ -52,7 +52,7 @@ class Session_LoggerTest extends PhraseanetPHPUnitAbstract
$ses_id = self::$DI['app']['session']->get('session_id');
$usr_id = self::$DI['app']['authentication']->getUser()->get_id();
self::$DI['app']['authentication']->closeAccount();
$this->logout(self::$DI['app']);
$sql = 'SELECT id FROM log
WHERE sit_session = :ses_id AND usrid = :usr_id AND site = :site';

View File

@@ -160,7 +160,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
public function testSearch_recordsWithRecords()
{
self::$DI['app']['authentication']->openAccount(self::$DI['user']);
$this->authenticate(self::$DI['app']);
$record = \record_adapter::createFromFile(BorderFile::buildFromPathfile(__DIR__ . '/../../../files/cestlafete.jpg', self::$DI['collection'], self::$DI['app']), self::$DI['app']);
@@ -240,7 +240,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
public function testSearch_recordsWithStories()
{
self::$DI['app']['authentication']->openAccount(self::$DI['user']);
$this->authenticate(self::$DI['app']);
$story = \record_adapter::createStory(self::$DI['app'], self::$DI['collection']);
@@ -272,7 +272,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
public function testSearchWithStories()
{
self::$DI['app']['authentication']->openAccount(self::$DI['user']);
$this->authenticate(self::$DI['app']);
$story = \record_adapter::createStory(self::$DI['app'], self::$DI['collection']);
@@ -307,7 +307,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
public function testSearchWithRecords()
{
self::$DI['app']['authentication']->openAccount(self::$DI['user']);
$this->authenticate(self::$DI['app']);
$record = \record_adapter::createFromFile(BorderFile::buildFromPathfile(__DIR__ . '/../../../files/cestlafete.jpg', self::$DI['collection'], self::$DI['app']), self::$DI['app']);