PHRAS-2859_tests-do-corrupt-conf-bis_4.1

fix new tests
This commit is contained in:
Jean-Yves Gaulier
2019-12-18 16:51:17 +01:00
parent f883748f40
commit d6c8eaa659
4 changed files with 42 additions and 6 deletions

View File

@@ -1281,7 +1281,7 @@ class ApiJsonTest extends ApiTestCase
$tochange = [];
foreach ($statusStructure as $n => $datas) {
$tochange[$n] = substr($record_status, ($n - 1), 1) == '0' ? '1' : '0';
$tochange[$n] = substr($record_status, $n, 1) == '0' ? '1' : '0';
}
$this->evaluateMethodNotAllowedRoute($route, ['GET', 'PUT', 'DELETE']);
@@ -1305,7 +1305,8 @@ class ApiJsonTest extends ApiTestCase
// test record_status in string
$record_status_expected = $record_status;
$pos = strpos($record_status, '1');
$bitToChange = [];
$pos = strpos($record_status, '1', 4);
$bitToChange[$pos] = '1';
$response = $this->request('POST', $route, $this->getParameters(['status' => $bitToChange]), ['HTTP_Accept' => $this->getAcceptMimeType()]);

View File

@@ -2017,6 +2017,9 @@ class LoginTest extends \PhraseanetAuthenticatedWebTestCase
{
$app = $this->getApplication();
$this->logout($app);
$bkp = $app['phraseanet.configuration']['session'];
$app['phraseanet.configuration']['session'] = [
'idle' => 10,
'lifetime' => 60475,
@@ -2027,12 +2030,17 @@ class LoginTest extends \PhraseanetAuthenticatedWebTestCase
$this->assertSame(200, $client->getResponse()->getStatusCode());
$this->assertEquals('hidden', $crawler->filter('input[name="remember-me"]')->attr('type'));
$app['phraseanet.configuration']['session'] = $bkp;
}
public function testLoginPageWithNoIdleSessionTime()
{
$app = $this->getApplication();
$this->logout($app);
$bkp = $app['phraseanet.configuration']['session'];
$app['phraseanet.configuration']['session'] = [
'idle' => 0,
'lifetime' => 60475,
@@ -2043,6 +2051,8 @@ class LoginTest extends \PhraseanetAuthenticatedWebTestCase
$this->assertSame(200, $client->getResponse()->getStatusCode());
$this->assertEquals('checkbox', $crawler->filter('input[name="remember-me"]')->attr('type'));
$app['phraseanet.configuration']['session'] = $bkp;
}
private function addUsrAuthDoctrineEntitySupport($id, $out, $participants = false)