mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 12:33:26 +00:00
Merge pull request #742 from romainneutron/fix-1555
Fix #1555 : API sessions remain open
This commit is contained in:
@@ -116,6 +116,15 @@ class Authenticator
|
||||
*/
|
||||
public function closeAccount()
|
||||
{
|
||||
if (!$this->session->has('session_id')) {
|
||||
throw new RuntimeException('No session to close.');
|
||||
}
|
||||
|
||||
if (null !== $session = $this->em->find('Entities\Session', $this->session->get('session_id'))) {
|
||||
$this->em->remove($session);
|
||||
$this->em->flush();
|
||||
}
|
||||
|
||||
$this->session->invalidate();
|
||||
$this->reinitUser();
|
||||
|
||||
|
@@ -162,6 +162,10 @@ class V1 implements ControllerProviderInterface
|
||||
);
|
||||
});
|
||||
|
||||
$controllers->after(function () use ($app) {
|
||||
$app['authentication']->closeAccount();
|
||||
});
|
||||
|
||||
/**
|
||||
* Method Not Allowed Closure
|
||||
*/
|
||||
|
@@ -35,8 +35,10 @@
|
||||
{% set row = session['session'] %}
|
||||
<tr id="row-{{ row.Id() }}">
|
||||
<td>
|
||||
{% if app['session'].get('phrasea_session_id') != row.Id() %}
|
||||
{% if app['session'].get('session_id') != row.Id() %}
|
||||
<a href="{{ path('delete_session', {"id": row.Id()}) }}" title="{% trans %}End Activity{% endtrans %}" class="btn btn-inverse btn-small delete-session"><i class="icon-remove"> {% trans %}End Activity{% endtrans %}</i></a>
|
||||
{% else %}
|
||||
{% trans 'Current session' %}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
|
@@ -148,6 +148,14 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
|
||||
$this->assertEquals(1, $preEvent);
|
||||
}
|
||||
|
||||
public function testThatSessionIsClosedAfterRequest()
|
||||
{
|
||||
$this->assertCount(0, self::$DI['app']['EM']->getRepository('Entities\Session')->findAll());
|
||||
$this->setToken(self::$token);
|
||||
self::$DI['client']->request('GET', '/api/v1/databoxes/list/', $this->getParameters(), array(), array('HTTP_Accept' => $this->getAcceptMimeType()));
|
||||
$this->assertCount(0, self::$DI['app']['EM']->getRepository('Entities\Session')->findAll());
|
||||
}
|
||||
|
||||
public function provideEventNames()
|
||||
{
|
||||
return array(
|
||||
|
@@ -39,7 +39,7 @@ class ApplicationLightboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
|
||||
|
||||
public function testRouteSlash()
|
||||
{
|
||||
self::$DI['app']['authentication']->openAccount(self::$DI['user']);
|
||||
$this->authenticate(self::$DI['app']);
|
||||
|
||||
$baskets = $this->insertFiveBasket();
|
||||
|
||||
@@ -66,7 +66,7 @@ class ApplicationLightboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
|
||||
|
||||
public function testAuthenticationWithToken()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
|
||||
$Basket = $this->insertOneBasket();
|
||||
$token = self::$DI['app']['tokens']->getUrlToken(\random::TYPE_VIEW, self::$DI['user_alt2']->get_id(), null, $Basket->getId());
|
||||
@@ -187,7 +187,7 @@ class ApplicationLightboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
|
||||
|
||||
public function testValidate()
|
||||
{
|
||||
self::$DI['app']['authentication']->openAccount(self::$DI['user']);
|
||||
$this->authenticate(self::$DI['app']);
|
||||
|
||||
$basket = $this->insertOneValidationBasket();
|
||||
|
||||
@@ -212,7 +212,7 @@ class ApplicationLightboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
|
||||
|
||||
public function testCompare()
|
||||
{
|
||||
self::$DI['app']['authentication']->openAccount(self::$DI['user']);
|
||||
$this->authenticate(self::$DI['app']);
|
||||
|
||||
$basket = $this->insertOneBasket();
|
||||
|
||||
@@ -237,7 +237,7 @@ class ApplicationLightboxTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
|
||||
|
||||
public function testFeedEntry()
|
||||
{
|
||||
self::$DI['app']['authentication']->openAccount(self::$DI['user']);
|
||||
$this->authenticate(self::$DI['app']);
|
||||
|
||||
$this->set_user_agent(self::USER_AGENT_FIREFOX8MAC, self::$DI['app']);
|
||||
|
||||
|
@@ -55,7 +55,7 @@ class ApplicationOverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
|
||||
|
||||
public function testDatafilesRouteNotAuthenticated()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['client']->request('GET', '/datafiles/' . self::$DI['record_1']->get_sbas_id() . '/' . self::$DI['record_1']->get_record_id() . '/preview/');
|
||||
|
||||
$this->assertForbiddenResponse(self::$DI['client']->getResponse());
|
||||
@@ -79,7 +79,7 @@ class ApplicationOverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
|
||||
|
||||
public function testDatafilesRouteNotAuthenticatedUnknownSubdef()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['client']->request('GET', '/datafiles/' . self::$DI['record_1']->get_sbas_id() . '/' . self::$DI['record_1']->get_record_id() . '/notfoundreview/');
|
||||
|
||||
$this->assertForbiddenResponse(self::$DI['client']->getResponse());
|
||||
@@ -96,7 +96,7 @@ class ApplicationOverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
|
||||
|
||||
public function testPermalinkNotAuthenticated()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
$this->assertFalse(self::$DI['app']['authentication']->isAuthenticated());
|
||||
$this->get_a_permalinkBCcompatibility(array("Content-Type" => "image/jpeg"));
|
||||
$this->get_a_permaviewBCcompatibility(array("Content-Type" => "text/html; charset=UTF-8"));
|
||||
@@ -112,7 +112,7 @@ class ApplicationOverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
|
||||
|
||||
public function testCaptionNotAuthenticated()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
$this->assertFalse(self::$DI['app']['authentication']->isAuthenticated());
|
||||
$this->get_a_caption(array("Content-Type" => "application/json"));
|
||||
}
|
||||
@@ -213,7 +213,7 @@ class ApplicationOverviewTest extends \PhraseanetWebTestCaseAuthenticatedAbstrac
|
||||
$entry = \Feed_Entry_Adapter::create(self::$DI['app'], $publicFeed, $publisher, 'titre', 'sub titre entry', 'author name', 'author email', false);
|
||||
$item = \Feed_Entry_Item::create(self::$DI['app']['phraseanet.appbox'], $entry, self::$DI['record_1']);
|
||||
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['client']->request('GET', '/permalink/v1/' . self::$DI['record_1']->get_sbas_id() . '/' . self::$DI['record_1']->get_record_id() . '/preview/');
|
||||
|
||||
$this->assertEquals(200, self::$DI['client']->getResponse()->getStatusCode());
|
||||
|
@@ -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
|
||||
*/
|
||||
|
@@ -11,7 +11,7 @@ class RootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testRouteSlash()
|
||||
{
|
||||
self::$DI['app']['authentication']->openAccount(self::$DI['user']);
|
||||
$this->authenticate(self::$DI['app']);
|
||||
|
||||
self::$DI['client']->request('GET', '/admin/', array('section' => 'base:featured'));
|
||||
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
||||
|
@@ -23,7 +23,7 @@ class RootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testGetClient()
|
||||
{
|
||||
self::$DI['app']['authentication']->openAccount(self::$DI['user']);
|
||||
$this->authenticate(self::$DI['app']);
|
||||
self::$DI['client']->request("GET", "/client/");
|
||||
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
||||
}
|
||||
|
@@ -30,7 +30,7 @@ class QueryTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testQueryAnswerTrain()
|
||||
{
|
||||
self::$DI['app']['authentication']->openAccount(self::$DI['user']);
|
||||
$this->authenticate(self::$DI['app']);
|
||||
self::$DI['record_24'];
|
||||
|
||||
$options = new SearchEngineOptions();
|
||||
|
@@ -83,7 +83,7 @@ class RecordsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testGetRecordDetailResult()
|
||||
{
|
||||
self::$DI['app']['authentication']->openAccount(self::$DI['user']);
|
||||
$this->authenticate(self::$DI['app']);
|
||||
self::$DI['record_24'];
|
||||
|
||||
$options = new SearchEngineOptions();
|
||||
@@ -119,7 +119,7 @@ class RecordsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testGetRecordDetailREG()
|
||||
{
|
||||
self::$DI['app']['authentication']->openAccount(self::$DI['user']);
|
||||
$this->authenticate(self::$DI['app']);
|
||||
self::$DI['record_story_1'];
|
||||
|
||||
$this->XMLHTTPRequest('POST', '/prod/records/', array(
|
||||
@@ -149,7 +149,7 @@ class RecordsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testGetRecordDetailBasket()
|
||||
{
|
||||
self::$DI['app']['authentication']->openAccount(self::$DI['user']);
|
||||
$this->authenticate(self::$DI['app']);
|
||||
$basket = $this->insertOneBasket();
|
||||
$record = self::$DI['record_1'];
|
||||
|
||||
@@ -191,7 +191,7 @@ class RecordsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testGetRecordDetailFeed()
|
||||
{
|
||||
self::$DI['app']['authentication']->openAccount(self::$DI['user']);
|
||||
$this->authenticate(self::$DI['app']);
|
||||
|
||||
self::$feed = \Feed_Adapter::create(
|
||||
self::$DI['app'],
|
||||
|
@@ -11,7 +11,7 @@ class ControllerRootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testRouteSlash()
|
||||
{
|
||||
self::$DI['app']['authentication']->openAccount(self::$DI['user']);
|
||||
$this->authenticate(self::$DI['app']);
|
||||
|
||||
$crawler = self::$DI['client']->request('GET', '/prod/');
|
||||
|
||||
|
@@ -15,7 +15,7 @@ class RootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
|
||||
public function testRouteDashboard()
|
||||
{
|
||||
self::$DI['app']['authentication']->openAccount(self::$DI['user']);
|
||||
$this->authenticate(self::$DI['app']);
|
||||
|
||||
self::$DI['client']->request('GET', '/report/dashboard');
|
||||
|
||||
@@ -26,7 +26,7 @@ class RootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
|
||||
public function testRouteDashboardJson()
|
||||
{
|
||||
self::$DI['app']['authentication']->openAccount(self::$DI['user']);
|
||||
$this->authenticate(self::$DI['app']);
|
||||
|
||||
$this->XMLHTTPRequest('GET', '/report/dashboard', array(
|
||||
'dmin' => $this->dmin->format('Y-m-d H:i:s'),
|
||||
|
@@ -55,7 +55,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
|
||||
public function testLoginRedirectPostLog()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
|
||||
self::$DI['client']->request('GET', '/login/', array('postlog' => '1', 'redirect' => 'prod'));
|
||||
$response = self::$DI['client']->getResponse();
|
||||
@@ -68,7 +68,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testLoginError($type, $message)
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['app']->addFlash($type, $message);
|
||||
|
||||
$crawler = self::$DI['client']->request('GET', '/login/');
|
||||
@@ -83,7 +83,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testRegisterConfirmMailNoCode()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['client']->request('GET', '/login/register-confirm/');
|
||||
$response = self::$DI['client']->getResponse();
|
||||
|
||||
@@ -97,7 +97,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testRegisterConfirmMailWrongCode()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['client']->request('GET', '/login/register-confirm/', array(
|
||||
'code' => '34dT0k3n'
|
||||
));
|
||||
@@ -113,7 +113,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testRegisterConfirmMailUserNotFound()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
$email = $this->generateEmail();
|
||||
$token = self::$DI['app']['tokens']->getUrlToken(\random::TYPE_EMAIL, 0, null, $email);
|
||||
self::$DI['client']->request('GET', '/login/register-confirm/', array(
|
||||
@@ -131,7 +131,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testRegisterConfirmMailUnlocked()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
$email = $this->generateEmail();
|
||||
$token = self::$DI['app']['tokens']->getUrlToken(\random::TYPE_EMAIL, self::$DI['user']->get_id(), null, $email);
|
||||
|
||||
@@ -152,7 +152,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
{
|
||||
$this->mockNotificationDeliverer('Alchemy\Phrasea\Notification\Mail\MailSuccessEmailConfirmationRegistered');
|
||||
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
$email = $this->generateEmail();
|
||||
$appboxRegister = new \appbox_register(self::$DI['app']['phraseanet.appbox']);
|
||||
$token = self::$DI['app']['tokens']->getUrlToken(\random::TYPE_EMAIL, self::$DI['user']->get_id(), null, $email);
|
||||
@@ -178,7 +178,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
|
||||
$user = \User_Adapter::create(self::$DI['app'], 'test'.mt_rand(), \random::generatePassword(), 'email-random'.mt_rand().'@phraseanet.com', false);
|
||||
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
$email = $this->generateEmail();
|
||||
$token = self::$DI['app']['tokens']->getUrlToken(\random::TYPE_EMAIL, $user->get_id(), null, $email);
|
||||
|
||||
@@ -201,7 +201,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testRenewPasswordInvalidEmail()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
$crawler = self::$DI['client']->request('POST', '/login/forgot-password/', array(
|
||||
'email' => 'invalid.email.com',
|
||||
'_token' => 'token',
|
||||
@@ -218,7 +218,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testRenewPasswordUnknowEmail()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
$crawler = self::$DI['client']->request('POST', '/login/forgot-password/', array(
|
||||
'email' => 'invalid_email@test.com',
|
||||
'_token' => 'token',
|
||||
@@ -236,7 +236,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
{
|
||||
$this->mockNotificationDeliverer('Alchemy\Phrasea\Notification\Mail\MailRequestPasswordUpdate');
|
||||
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['client']->request('POST', '/login/forgot-password/', array(
|
||||
'email' => self::$DI['user']->get_email(),
|
||||
'_token' => 'token',
|
||||
@@ -253,7 +253,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testRenewPasswordBadArguments()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
$token = self::$DI['app']['tokens']->getUrlToken(\random::TYPE_PASSWORD, self::$DI['user']->get_id());
|
||||
$crawler = self::$DI['client']->request('POST', '/login/renew-password/', array(
|
||||
'token' => $token,
|
||||
@@ -269,7 +269,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
|
||||
public function testRenewPasswordBadToken()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['client']->request('POST', '/login/renew-password/', array(
|
||||
'token' => 'badToken',
|
||||
'_token' => 'token',
|
||||
@@ -296,7 +296,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
|
||||
public function testRenewPasswordNoToken()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['client']->request('POST', '/login/renew-password/', array(
|
||||
'_token' => 'token',
|
||||
'password' => array('password' => 'password', 'confirm' => 'password')
|
||||
@@ -325,7 +325,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testRenewPassword()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
$token = self::$DI['app']['tokens']->getUrlToken(\random::TYPE_PASSWORD, self::$DI['user']->get_id());
|
||||
|
||||
self::$DI['client']->request('POST', '/login/renew-password/', array(
|
||||
@@ -347,7 +347,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testRenewPasswordPageShowsFlashMessages($type, $message)
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['app']->addFlash($type, $message);
|
||||
|
||||
$token = self::$DI['app']['tokens']->getUrlToken(\random::TYPE_PASSWORD, self::$DI['user']->get_id());
|
||||
@@ -363,7 +363,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
|
||||
public function testForgotPasswordGet()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['client']->request('GET', '/login/forgot-password/');
|
||||
|
||||
$this->assertTrue(self::$DI['client']->getResponse()->isOk());
|
||||
@@ -381,7 +381,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
|
||||
public function testForgotPasswordInvalidEmail()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
$crawler = self::$DI['client']->request('POST', '/login/forgot-password/', array(
|
||||
'_token' => 'token',
|
||||
'email' => 'invalid.email',
|
||||
@@ -395,7 +395,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
|
||||
public function testForgotPasswordWrongEmail()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
$crawler = self::$DI['client']->request('POST', '/login/forgot-password/', array(
|
||||
'_token' => 'token',
|
||||
'email' => 'invalid@email.com',
|
||||
@@ -411,7 +411,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
{
|
||||
$this->mockNotificationDeliverer('Alchemy\Phrasea\Notification\Mail\MailRequestPasswordUpdate');
|
||||
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
$crawler = self::$DI['client']->request('POST', '/login/forgot-password/', array(
|
||||
'_token' => 'token',
|
||||
'email' => self::$DI['user']->get_email(),
|
||||
@@ -429,7 +429,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
public function testGetRegister($type, $message)
|
||||
{
|
||||
self::$DI['app']['registration.enabled'] = true;
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['app']->addFlash($type, $message);
|
||||
$crawler = self::$DI['client']->request('GET', '/login/register-classic/');
|
||||
|
||||
@@ -442,7 +442,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
public function testGetRegisterWithRegisterIdBindDataToForm()
|
||||
{
|
||||
self::$DI['app']['registration.enabled'] = true;
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
|
||||
$provider = $this->getMock('Alchemy\Phrasea\Authentication\Provider\ProviderInterface');
|
||||
|
||||
@@ -488,7 +488,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
public function testGetPostRegisterWhenRegistrationDisabled($method, $route)
|
||||
{
|
||||
self::$DI['app']['registration.enabled'] = false;
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['client']->request($method, $route);
|
||||
$this->assertEquals(404, self::$DI['client']->getResponse()->getStatusCode());
|
||||
}
|
||||
@@ -501,7 +501,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
self::$DI['app']['registration.enabled'] = true;
|
||||
self::$DI['app']['registration.fields'] = $extraParameters;
|
||||
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
|
||||
$parameters = array_merge(array('_token' => 'token'), $parameters);
|
||||
foreach ($parameters as $key => $parameter) {
|
||||
@@ -528,7 +528,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
|
||||
public function testPostRegisterWithoutParams()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
$crawler = self::$DI['client']->request('POST', '/login/register-classic/');
|
||||
|
||||
$this->assertFalse(self::$DI['client']->getResponse()->isRedirect());
|
||||
@@ -782,7 +782,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
public function testPostRegisterWithProviderIdAndAlreadyBoundProvider()
|
||||
{
|
||||
self::$DI['app']['registration.fields'] = array();
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
|
||||
$provider = $this->getMock('Alchemy\Phrasea\Authentication\Provider\ProviderInterface');
|
||||
$this->addProvider('provider-test', $provider);
|
||||
@@ -832,7 +832,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
public function testPostRegisterWithUnknownProvider()
|
||||
{
|
||||
self::$DI['app']['registration.fields'] = array();
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
|
||||
$parameters = array_merge(array('_token' => 'token'), array(
|
||||
"password" => array(
|
||||
@@ -867,7 +867,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
public function testPostRegisterWithProviderNotAuthenticated()
|
||||
{
|
||||
self::$DI['app']['registration.fields'] = array();
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
|
||||
$provider = $this->getMock('Alchemy\Phrasea\Authentication\Provider\ProviderInterface');
|
||||
$this->addProvider('provider-test', $provider);
|
||||
@@ -909,7 +909,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
public function testPostRegisterWithProviderId()
|
||||
{
|
||||
self::$DI['app']['registration.fields'] = array();
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
|
||||
$emails = array(
|
||||
'Alchemy\Phrasea\Notification\Mail\MailRequestEmailConfirmation'=>0,
|
||||
@@ -983,7 +983,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
{
|
||||
self::$DI['app']['registration.fields'] = $extraParameters;
|
||||
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
|
||||
$emails = array(
|
||||
'Alchemy\Phrasea\Notification\Mail\MailRequestEmailConfirmation'=>0,
|
||||
@@ -1044,7 +1044,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testSendConfirmMailBadRequest()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['client']->request('GET', '/login/send-mail-confirm/');
|
||||
|
||||
$this->assertBadResponse(self::$DI['client']->getResponse());
|
||||
@@ -1057,7 +1057,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
{
|
||||
$this->mockNotificationDeliverer('Alchemy\Phrasea\Notification\Mail\MailRequestEmailConfirmation');
|
||||
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['client']->request('GET', '/login/send-mail-confirm/', array('usr_id' => self::$DI['user']->get_id()));
|
||||
|
||||
$response = self::$DI['client']->getResponse();
|
||||
@@ -1071,7 +1071,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testSendConfirmMailWrongUser()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['client']->request('GET', '/login/send-mail-confirm/', array('usr_id' => 0));
|
||||
|
||||
$response = self::$DI['client']->getResponse();
|
||||
@@ -1091,7 +1091,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
self::$DI['app']['authentication']->getUser()->set_password($password);
|
||||
self::$DI['app']['authentication']->getUser()->set_mail_locked(false);
|
||||
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
|
||||
self::$DI['client'] = new Client(self::$DI['app'], array());
|
||||
$this->set_user_agent(self::USER_AGENT_FIREFOX8MAC, self::$DI['app']);
|
||||
@@ -1116,7 +1116,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
self::$DI['app']['authentication']->getUser()->set_password($password);
|
||||
self::$DI['app']['authentication']->getUser()->set_mail_locked(false);
|
||||
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
|
||||
$preEvent = 0;
|
||||
$phpunit = $this;
|
||||
@@ -1163,7 +1163,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
$login = self::$DI['app']['authentication']->getUser()->get_login();
|
||||
self::$DI['app']['authentication']->getUser()->set_password($password);
|
||||
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
|
||||
self::$DI['client'] = new Client(self::$DI['app'], array());
|
||||
$this->set_user_agent(self::USER_AGENT_FIREFOX8MAC, self::$DI['app']);
|
||||
@@ -1189,7 +1189,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
|
||||
$user->ACL()->give_access_to_base(array(self::$DI['collection']->get_base_id()));
|
||||
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
|
||||
self::$DI['client'] = new Client(self::$DI['app'], array());
|
||||
$this->set_user_agent(self::USER_AGENT_FIREFOX8MAC, self::$DI['app']);
|
||||
@@ -1221,7 +1221,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
$user = \User_Adapter::getInstance($usr_id, self::$DI['app']);
|
||||
$user->ACL()->give_access_to_base(array(self::$DI['collection']->get_base_id()));
|
||||
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
|
||||
self::$DI['client'] = new Client(self::$DI['app'], array());
|
||||
$this->set_user_agent(self::USER_AGENT_FIREFOX8MAC, self::$DI['app']);
|
||||
@@ -1235,7 +1235,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testGuestAuthenticateWithGetMethod()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
|
||||
self::$DI['client'] = new Client(self::$DI['app'], array());
|
||||
$this->set_user_agent(self::USER_AGENT_FIREFOX8MAC, self::$DI['app']);
|
||||
@@ -1255,7 +1255,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testBadAuthenticate()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['client']->request('POST', '/login/authenticate/', array(
|
||||
'login' => self::$DI['user']->get_login(),
|
||||
'password' => 'test',
|
||||
@@ -1272,7 +1272,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testBadAuthenticateCheckRedirect()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['client']->request('POST', '/login/authenticate/', array(
|
||||
'login' => self::$DI['user']->get_login(),
|
||||
'password' => 'test',
|
||||
@@ -1290,7 +1290,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testMailLockedAuthenticate()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
$password = \random::generatePassword();
|
||||
self::$DI['user']->set_mail_locked(true);
|
||||
self::$DI['client']->request('POST', '/login/authenticate/', array(
|
||||
@@ -1327,7 +1327,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
->with($parameters)
|
||||
->will($this->returnValue($response));
|
||||
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['client']->request('GET', '/login/provider/provider-test/authenticate/', $parameters);
|
||||
|
||||
$this->assertSame($response, self::$DI['client']->getResponse());
|
||||
@@ -1367,7 +1367,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
->with($this->equalTo('provider-test'))
|
||||
->will($this->throwException(new InvalidArgumentException('Provider not found')));
|
||||
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['client']->request($method, $route);
|
||||
|
||||
$this->assertEquals(404, self::$DI['client']->getResponse()->getStatusCode());
|
||||
@@ -1398,7 +1398,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
->method('onCallback')
|
||||
->will($this->throwException(new NotAuthenticatedException('Not authenticated.')));
|
||||
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['client']->request('GET', '/login/provider/provider-test/callback/');
|
||||
|
||||
$this->assertSame(302, self::$DI['client']->getResponse()->getStatusCode());
|
||||
@@ -1428,7 +1428,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
->method('getToken')
|
||||
->will($this->returnValue($token));
|
||||
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['client']->request('GET', '/login/provider/provider-test/callback/');
|
||||
|
||||
$this->assertSame(302, self::$DI['client']->getResponse()->getStatusCode());
|
||||
@@ -1462,7 +1462,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
->with($token)
|
||||
->will($this->returnValue($user));
|
||||
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['client']->request('GET', '/login/provider/provider-test/callback/');
|
||||
|
||||
$this->assertSame(302, self::$DI['client']->getResponse()->getStatusCode());
|
||||
@@ -1537,7 +1537,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
->method('isEnabled')
|
||||
->will($this->returnValue(true));
|
||||
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['client']->request('GET', '/login/provider/provider-test/callback/');
|
||||
|
||||
$this->assertSame(302, self::$DI['client']->getResponse()->getStatusCode());
|
||||
@@ -1589,7 +1589,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
|
||||
self::$DI['app']['registration.enabled'] = true;
|
||||
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['client']->request('GET', '/login/provider/provider-test/callback/');
|
||||
|
||||
$this->assertSame(302, self::$DI['client']->getResponse()->getStatusCode());
|
||||
@@ -1632,7 +1632,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
|
||||
self::$DI['app']['registration.enabled'] = false;
|
||||
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['client']->request('GET', '/login/provider/provider-test/callback/');
|
||||
|
||||
$this->assertSame(302, self::$DI['client']->getResponse()->getStatusCode());
|
||||
@@ -1651,7 +1651,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
);
|
||||
self::$DI['app']['registration.fields'] = $fields;
|
||||
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['client']->request('GET', '/login/registration-fields/');
|
||||
|
||||
$this->assertSame(200, self::$DI['client']->getResponse()->getStatusCode());
|
||||
@@ -1662,7 +1662,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
|
||||
public function testRegisterRedirectsNoAuthProvidersAvailable()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
|
||||
self::$DI['app']['authentication.providers'] = new ProvidersCollection();
|
||||
|
||||
@@ -1674,7 +1674,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
|
||||
public function testRegisterDisplaysIfAuthProvidersAvailable()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
|
||||
$provider = $this->getMock('Alchemy\Phrasea\Authentication\Provider\ProviderInterface');
|
||||
$provider->expects($this->any())
|
||||
|
@@ -83,7 +83,7 @@ class RootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
public function testNoPersistentCookie()
|
||||
{
|
||||
$app = self::$DI['app'];
|
||||
$app['authentication']->closeAccount();
|
||||
$this->logout($app);
|
||||
|
||||
$boolean = false;
|
||||
|
||||
@@ -102,7 +102,7 @@ class RootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
public function testPersistentCookie()
|
||||
{
|
||||
$app = self::$DI['app'];
|
||||
$app['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
|
||||
$browser = $this->getMockBuilder('\Browser')
|
||||
->disableOriginalConstructor()
|
||||
|
@@ -38,7 +38,7 @@ class SessionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testUpdSession()
|
||||
{
|
||||
self::$DI['app']['authentication']->openAccount(self::$DI['user']);
|
||||
$this->authenticate(self::$DI['app']);
|
||||
|
||||
$this->XMLHTTPRequest('POST', '/session/update/', array(
|
||||
'usr' => self::$DI['user']->get_id(),
|
||||
@@ -55,7 +55,7 @@ class SessionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testUpdSessionBadRequestMissingModuleArgument()
|
||||
{
|
||||
self::$DI['app']['authentication']->openAccount(self::$DI['user']);
|
||||
$this->authenticate(self::$DI['app']);
|
||||
|
||||
$this->XMLHTTPRequest('POST', '/session/update/', array(
|
||||
'usr' => self::$DI['user']->get_id()
|
||||
|
@@ -39,7 +39,7 @@ class SearchEngineOptionsTest extends \PhraseanetPHPUnitAbstract
|
||||
*/
|
||||
public function testFromRequest()
|
||||
{
|
||||
self::$DI['app']['authentication']->openAccount(self::$DI['user']);
|
||||
$this->authenticate(self::$DI['app']);
|
||||
|
||||
foreach ($this->provideRequestData() as $pack) {
|
||||
list ($query, $request, $field, $dateField) = $pack;
|
||||
|
@@ -19,7 +19,7 @@ class FirewallTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testRequiredAuthNotAuthenticated()
|
||||
{
|
||||
self::$DI['app']['authentication']->closeAccount();
|
||||
$this->logout(self::$DI['app']);
|
||||
self::$DI['app']['firewall']->requireAuthentication(self::$DI['app']);
|
||||
}
|
||||
}
|
||||
|
@@ -920,6 +920,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();
|
||||
}
|
||||
|
||||
|
@@ -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';
|
||||
|
@@ -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']);
|
||||
|
||||
|
Reference in New Issue
Block a user