Merge branch 'master' of https://github.com/alchemy-fr/Phraseanet into PHRAS-2741-worker-service-part1

This commit is contained in:
aynsix
2019-12-19 16:09:47 +04:00
135 changed files with 5869 additions and 2251 deletions

View File

@@ -229,6 +229,9 @@ class FieldsTest extends \PhraseanetAuthenticatedWebTestCase
'dces-element' => null,
'vocabulary-type' => 'User',
'vocabulary-restricted' => true,
'gui_editable' => true,
'gui_visible' => true,
'generate_cterms' => true,
]);
$response = $this->request("POST", sprintf("/admin/fields/%d/fields", $databox->get_sbas_id()), [], [], $body);

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

@@ -132,9 +132,11 @@ class ExportTest extends \PhraseanetAuthenticatedWebTestCase
{
$app = $this->getApplication();
$bkp = $app['conf']->get('registry');
if (!$app['conf']->get(['registry', 'ftp', 'ftp-enabled'])) {
$app['conf']->set(['registry', 'ftp', 'ftp-enabled'], true);
self::$GV_activeFTP = true;
self::$GV_activeFTP = true;
}
/** @var User $user */
@@ -158,6 +160,8 @@ class ExportTest extends \PhraseanetAuthenticatedWebTestCase
$this->assertArrayHasKey('message', $datas);
$this->assertTrue($datas['success']);
unset($response, $datas);
$app['conf']->set('registry', $bkp);
}
/**

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)