mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 23:13:15 +00:00
Fix tests and templates
This commit is contained in:
@@ -169,7 +169,6 @@ class Description implements ControllerProviderInterface
|
||||
$field->set_name($request->get('name_' . $id))
|
||||
->set_thumbtitle($request->get('thumbtitle_' . $id))
|
||||
->set_tag(\databox_field::loadClassFromTagName($request->get('src_' . $id)))
|
||||
->set_multi($request->get('multi_' . $id))
|
||||
->set_business($request->get('business_' . $id))
|
||||
->set_indexable($request->get('indexable_' . $id))
|
||||
->set_required($request->get('required_' . $id))
|
||||
|
@@ -13,7 +13,6 @@ namespace Alchemy\Phrasea\Controller\Admin;
|
||||
|
||||
use Alchemy\Phrasea\Application as PhraseaApplication;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Silex\Application;
|
||||
use Silex\ControllerProviderInterface;
|
||||
|
||||
@@ -94,7 +93,7 @@ class Publications implements ControllerProviderInterface
|
||||
'message' => '',
|
||||
);
|
||||
|
||||
$feed = new \Feed_Adapter($appbox, $id);
|
||||
$feed = new \Feed_Adapter($app['phraseanet.appbox'], $id);
|
||||
|
||||
$user = $app['phraseanet.core']->getAuthenticatedUser();
|
||||
|
||||
@@ -154,19 +153,15 @@ class Publications implements ControllerProviderInterface
|
||||
$datas['message'] = _('Unable to add file to Phraseanet');
|
||||
}
|
||||
|
||||
return new Response(
|
||||
$app['phraseanet.core']['Serializer']->serialize($datas, 'json'),
|
||||
200,
|
||||
array('Content-type' => 'application/json')
|
||||
);
|
||||
return $app->json($datas);
|
||||
})->assert('id', '\d+');
|
||||
|
||||
$controllers->post('/feed/{id}/addpublisher/', function($id) use ($app, $appbox) {
|
||||
$controllers->post('/feed/{id}/addpublisher/', function(PhraseaApplication $app, $id) {
|
||||
$error = '';
|
||||
try {
|
||||
$request = $app['request'];
|
||||
$user = \User_Adapter::getInstance($request->get('usr_id'), $appbox);
|
||||
$feed = new \Feed_Adapter($appbox, $id);
|
||||
$user = \User_Adapter::getInstance($request->get('usr_id'), $app['phraseanet.appbox']);
|
||||
$feed = new \Feed_Adapter($app['phraseanet.appbox'], $id);
|
||||
$feed->add_publisher($user);
|
||||
} catch (\Exception $e) {
|
||||
$error = $e->getMessage();
|
||||
@@ -175,12 +170,12 @@ class Publications implements ControllerProviderInterface
|
||||
return $app->redirect('/admin/publications/feed/' . $id . '/?err=' . $error);
|
||||
})->assert('id', '\d+');
|
||||
|
||||
$controllers->post('/feed/{id}/removepublisher/', function($id) use ($app, $appbox) {
|
||||
$controllers->post('/feed/{id}/removepublisher/', function(PhraseaApplication $app, $id) {
|
||||
try {
|
||||
$request = $app['request'];
|
||||
|
||||
$feed = new \Feed_Adapter($appbox, $id);
|
||||
$publisher = new \Feed_Publisher_Adapter($appbox, $request->get('publisher_id'));
|
||||
$feed = new \Feed_Adapter($app['phraseanet.appbox'], $id);
|
||||
$publisher = new \Feed_Publisher_Adapter($app['phraseanet.appbox'], $request->get('publisher_id'));
|
||||
$user = $publisher->get_user();
|
||||
if ($feed->is_publisher($user) === true && $feed->is_owner($user) === false)
|
||||
$publisher->delete();
|
||||
@@ -191,8 +186,8 @@ class Publications implements ControllerProviderInterface
|
||||
return $app->redirect('/admin/publications/feed/' . $id . '/?err=' . $error);
|
||||
})->assert('id', '\d+');
|
||||
|
||||
$controllers->post('/feed/{id}/delete/', function($id) use ($app, $appbox) {
|
||||
$feed = new \Feed_Adapter($appbox, $id);
|
||||
$controllers->post('/feed/{id}/delete/', function(PhraseaApplication $app, $id) {
|
||||
$feed = new \Feed_Adapter($app['phraseanet.appbox'], $id);
|
||||
$feed->delete();
|
||||
|
||||
return $app->redirect('/admin/publications/list/');
|
||||
|
@@ -15,8 +15,8 @@ use Silex\Application;
|
||||
use Silex\ControllerProviderInterface;
|
||||
use Silex\ControllerCollection;
|
||||
use Alchemy\Phrasea\Helper\Record as RecordHelper;
|
||||
use Symfony\Component\HttpFoundation\Request,
|
||||
Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@@ -479,8 +479,7 @@ class Account implements ControllerProviderInterface
|
||||
public function accountAuthorizedApps(Application $app, Request $request)
|
||||
{
|
||||
return $app['phraseanet.core']['Twig']->render('account/authorized_apps.html.twig', array(
|
||||
"apps" => \API_OAuth2_Application::load_app_by_user(\appbox::get_instance($app['phraseanet.core']), $user),
|
||||
'user' => $app['phraseanet.core']->getAuthenticatedUser()
|
||||
"apps" => \API_OAuth2_Application::load_app_by_user(\appbox::get_instance($app['phraseanet.core']), $app['phraseanet.core']->getAuthenticatedUser()),
|
||||
));
|
||||
}
|
||||
|
||||
|
@@ -268,7 +268,7 @@ class Developers implements ControllerProviderInterface
|
||||
$error = true;
|
||||
}
|
||||
|
||||
return new JsonResponse(array('success' => ! $error, 'token' => $accessToken));
|
||||
return new JsonResponse(array('success' => ! $error, 'token' => $accessToken));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -30,10 +30,10 @@ class Login implements ControllerProviderInterface
|
||||
|
||||
|
||||
|
||||
$controllers->get('/', $this->call('login'))
|
||||
$controllers->get('/', $this->call('login'))
|
||||
->before(function() use ($app) {
|
||||
return $app['phraseanet.core']['Firewall']->requireNotAuthenticated($app);
|
||||
});
|
||||
return $app['phraseanet.core']['Firewall']->requireNotAuthenticated($app);
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -386,10 +386,10 @@ class Login implements ControllerProviderInterface
|
||||
$appRedirect = $request->get("app");
|
||||
|
||||
// try {
|
||||
$session = $app['phraseanet.appbox']->get_session();
|
||||
$session = $app['phraseanet.appbox']->get_session();
|
||||
|
||||
$session->logout();
|
||||
$session->remove_cookies();
|
||||
$session->logout();
|
||||
$session->remove_cookies();
|
||||
// } catch (\Exception $e) {
|
||||
// return $app->redirect("/" . ($appRedirect ? $appRedirect : 'prod'));
|
||||
// }
|
||||
@@ -397,7 +397,6 @@ class Login implements ControllerProviderInterface
|
||||
return $app->redirect("/login/?logged_out=user" . ($appRedirect ? sprintf("&redirect=/%s", $appRedirect) : ""));
|
||||
}
|
||||
|
||||
|
||||
public function login(Application $app, Request $request)
|
||||
{
|
||||
$appbox = $app['phraseanet.appbox'];
|
||||
@@ -503,17 +502,16 @@ class Login implements ControllerProviderInterface
|
||||
$twig = $core->getTwig();
|
||||
|
||||
return $twig->render('login/index.twig', array(
|
||||
'module_name' => _('Accueil'),
|
||||
'notice' => $notice,
|
||||
'warning' => $warning,
|
||||
'redirect' => $request->get('redirect'),
|
||||
'logged_out' => $request->get('logged_out'),
|
||||
'captcha_system' => $captchaSys,
|
||||
'login' => new \login(),
|
||||
'feeds' => $feeds,
|
||||
'display_layout' => $registry->get('GV_home_publi')
|
||||
));
|
||||
|
||||
'module_name' => _('Accueil'),
|
||||
'notice' => $notice,
|
||||
'warning' => $warning,
|
||||
'redirect' => $request->get('redirect'),
|
||||
'logged_out' => $request->get('logged_out'),
|
||||
'captcha_system' => $captchaSys,
|
||||
'login' => new \login(),
|
||||
'feeds' => $feeds,
|
||||
'display_layout' => $registry->get('GV_home_publi')
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -43,13 +43,13 @@ class Upgrader implements ControllerProviderInterface
|
||||
);
|
||||
});
|
||||
|
||||
$controllers->get('/status/', function() use ($app) {
|
||||
$controllers->get('/status/', function(Application $app) {
|
||||
require_once __DIR__ . '/../../../../bootstrap.php';
|
||||
|
||||
return $app->json(\Setup_Upgrade::get_status());
|
||||
});
|
||||
|
||||
$controllers->post('/execute/', function() use ($app) {
|
||||
$controllers->post('/execute/', function(Application $app) {
|
||||
require_once __DIR__ . '/../../../../bootstrap.php';
|
||||
set_time_limit(0);
|
||||
session_write_close();
|
||||
@@ -62,7 +62,7 @@ class Upgrader implements ControllerProviderInterface
|
||||
/**
|
||||
* @todo Show recomandation instead of redirect
|
||||
*/
|
||||
return new $app->redirect('/');
|
||||
return $app->redirect('/');
|
||||
});
|
||||
|
||||
return $controllers;
|
||||
|
@@ -27,23 +27,21 @@ class PathFileTest implements ControllerProviderInterface
|
||||
{
|
||||
$controllers = $app['controllers_factory'];
|
||||
|
||||
$controllers->get('/path/', function( Request $request) {
|
||||
$path = $request->get('path');
|
||||
$controllers->get('/path/', function(Application $app, Request $request) {
|
||||
|
||||
return $app->json(array(
|
||||
'exists' => file_exists($path)
|
||||
, 'file' => is_file($path)
|
||||
, 'dir' => is_dir($path)
|
||||
, 'readable' => is_readable($path)
|
||||
, 'writeable' => is_writable($path)
|
||||
, 'executable' => is_executable($path)
|
||||
'exists' => file_exists($request->get('path'))
|
||||
, 'file' => is_file($request->get('path'))
|
||||
, 'dir' => is_dir($request->get('path'))
|
||||
, 'readable' => is_readable($request->get('path'))
|
||||
, 'writeable' => is_writable($request->get('path'))
|
||||
, 'executable' => is_executable($request->get('path'))
|
||||
));
|
||||
});
|
||||
|
||||
$controllers->get('/url/', function( Request $request) {
|
||||
$url = $request->get('url');
|
||||
$controllers->get('/url/', function(Application $app, Request $request) {
|
||||
|
||||
return $app->json(array('code' => \http_query::getHttpCodeFromUrl($url)));
|
||||
return $app->json(array('code' => \http_query::getHttpCodeFromUrl($request->get('url'))));
|
||||
});
|
||||
|
||||
return $controllers;
|
||||
|
@@ -38,10 +38,10 @@
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{{ row['created_on'] |getDate }}
|
||||
{{ row['created_on'] |formatDate }}
|
||||
</td>
|
||||
<td>
|
||||
{{ row['lastaccess'] |getDate }}
|
||||
{{ row['lastaccess'] |formatDate }}
|
||||
</td>
|
||||
<td>
|
||||
{{ row['ip'] }}
|
||||
|
@@ -67,7 +67,7 @@
|
||||
<a href="/admin/publications/feed/{{ feed.get_id() }}/">{{ feed.get_title() }}</a>
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
{{ feed.get_created_on()|formatdate }}
|
||||
{{ feed.get_created_on()|formatDate }}
|
||||
</td>
|
||||
<td style="text-align: center;">
|
||||
{% if feed.get_collection() != null %}
|
||||
|
@@ -128,7 +128,7 @@
|
||||
{{usr.get_applied_template()}}
|
||||
</td>
|
||||
<td>
|
||||
{{usr.get_creation_date()|getDate}}
|
||||
{{usr.get_creation_date()|formatDate}}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
@@ -45,7 +45,7 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testListElement()
|
||||
{
|
||||
$originalEm = $this->app['Core']['EM'];
|
||||
$originalEm = $this->app['phraseanet.core']['EM'];
|
||||
|
||||
$fileLazaret = $this->getMock('Entities\LazaretFile', array('getRecordsToSubstitute', 'getSession', 'getCollection'), array(), '', false);
|
||||
|
||||
@@ -81,13 +81,13 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
|
||||
$route = '/lazaret/';
|
||||
|
||||
$this->app['Core']['EM'] = $em;
|
||||
$this->app['phraseanet.core']['EM'] = $em;
|
||||
|
||||
$crawler = $this->client->request(
|
||||
'GET', $route
|
||||
);
|
||||
|
||||
$this->app['Core']['EM'] = $originalEm;
|
||||
$this->app['phraseanet.core']['EM'] = $originalEm;
|
||||
|
||||
$this->assertResponseOk($this->client->getResponse());
|
||||
|
||||
@@ -101,7 +101,7 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testGetElement()
|
||||
{
|
||||
$originalEm = $this->app['Core']['EM'];
|
||||
$originalEm = $this->app['phraseanet.core']['EM'];
|
||||
|
||||
$em = $this->getMock('Doctrine\ORM\EntityManager', array('find'), array(), '', false);
|
||||
|
||||
@@ -114,11 +114,11 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
->with($this->EqualTo('Entities\LazaretFile'), $this->EqualTo($id))
|
||||
->will($this->returnValue($lazaretFile));
|
||||
|
||||
$this->app['Core']['EM'] = $em;
|
||||
$this->app['phraseanet.core']['EM'] = $em;
|
||||
|
||||
$this->client->request('GET', '/lazaret/' . $id . '/');
|
||||
|
||||
$this->app['Core']['EM'] = $originalEm;
|
||||
$this->app['phraseanet.core']['EM'] = $originalEm;
|
||||
|
||||
$response = $this->client->getResponse();
|
||||
|
||||
@@ -145,7 +145,7 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testGetElementException()
|
||||
{
|
||||
$originalEm = $this->app['Core']['EM'];
|
||||
$originalEm = $this->app['phraseanet.core']['EM'];
|
||||
|
||||
$em = $this->getMock('Doctrine\ORM\EntityManager', array('find'), array(), '', false);
|
||||
|
||||
@@ -156,11 +156,11 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
->with($this->EqualTo('Entities\LazaretFile'), $this->EqualTo($id))
|
||||
->will($this->returnValue(null));
|
||||
|
||||
$this->app['Core']['EM'] = $em;
|
||||
$this->app['phraseanet.core']['EM'] = $em;
|
||||
|
||||
$this->client->request('GET', '/lazaret/' . $id . '/');
|
||||
|
||||
$this->app['Core']['EM'] = $originalEm;
|
||||
$this->app['phraseanet.core']['EM'] = $originalEm;
|
||||
|
||||
$response = $this->client->getResponse();
|
||||
|
||||
@@ -175,15 +175,15 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testAddElement()
|
||||
{
|
||||
$originalEm = $this->app['Core']['EM'];
|
||||
$originalEm = $this->app['phraseanet.core']['EM'];
|
||||
|
||||
//mock Doctrine\ORM\EntityManager
|
||||
$em = $this->getMock('Doctrine\ORM\EntityManager', array(), array(), '', false);
|
||||
|
||||
$lazaretFile = $this->getOneLazaretFile();
|
||||
|
||||
$lazaretFileName = $this->app['Core']->getRegistry()->get('GV_RootPath') . 'tmp/lazaret/' . $lazaretFile->getFilename();
|
||||
$lazaretThumbFileName = $this->app['Core']->getRegistry()->get('GV_RootPath') . 'tmp/lazaret/' . $lazaretFile->getThumbFilename();
|
||||
$lazaretFileName = $this->app['phraseanet.core']->getRegistry()->get('GV_RootPath') . 'tmp/lazaret/' . $lazaretFile->getFilename();
|
||||
$lazaretThumbFileName = $this->app['phraseanet.core']->getRegistry()->get('GV_RootPath') . 'tmp/lazaret/' . $lazaretFile->getThumbFilename();
|
||||
|
||||
copy(__DIR__ . '/../../../../testfiles/cestlafete.jpg', $lazaretFileName);
|
||||
copy(__DIR__ . '/../../../../testfiles/cestlafete.jpg', $lazaretThumbFileName);
|
||||
@@ -233,7 +233,7 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
$em->expects($this->once())
|
||||
->method('flush');
|
||||
|
||||
$this->app['Core']['EM'] = $em;
|
||||
$this->app['phraseanet.core']['EM'] = $em;
|
||||
|
||||
$this->client->request('POST', '/lazaret/' . $id . '/force-add/', array(
|
||||
'bas_id' => $lazaretFile->getBaseId(),
|
||||
@@ -241,7 +241,7 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
'attributes' => array(1, 2, 3, 4) //Check only the four first attributes
|
||||
));
|
||||
|
||||
$this->app['Core']['EM'] = $originalEm;
|
||||
$this->app['phraseanet.core']['EM'] = $originalEm;
|
||||
|
||||
$response = $this->client->getResponse();
|
||||
$this->assertResponseOk($response);
|
||||
@@ -257,7 +257,7 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testAddElementBadRequestException()
|
||||
{
|
||||
$originalEm = $this->app['Core']['EM'];
|
||||
$originalEm = $this->app['phraseanet.core']['EM'];
|
||||
|
||||
//mock Doctrine\ORM\EntityManager
|
||||
$em = $this->getMock('Doctrine\ORM\EntityManager', array(), array(), '', false);
|
||||
@@ -272,7 +272,7 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
->with($this->EqualTo('Entities\LazaretFile'), $this->EqualTo($id))
|
||||
->will($this->returnValue($lazaretFile));
|
||||
|
||||
$this->app['Core']['EM'] = $em;
|
||||
$this->app['phraseanet.core']['EM'] = $em;
|
||||
|
||||
//Ommit base_id mandatory param
|
||||
$this->client->request('POST', '/lazaret/' . $id . '/force-add/', array(
|
||||
@@ -280,7 +280,7 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
'attributes' => array(1, 2, 3, 4) //Check only the four first attributes
|
||||
));
|
||||
|
||||
$this->app['Core']['EM'] = $originalEm;
|
||||
$this->app['phraseanet.core']['EM'] = $originalEm;
|
||||
|
||||
$response = $this->client->getResponse();
|
||||
|
||||
@@ -295,7 +295,7 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testAddElementException()
|
||||
{
|
||||
$originalEm = $this->app['Core']['EM'];
|
||||
$originalEm = $this->app['phraseanet.core']['EM'];
|
||||
|
||||
$this->client->request('POST', '/lazaret/99999/force-add/', array(
|
||||
'bas_id' => 1,
|
||||
@@ -303,7 +303,7 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
'attributes' => array(1, 2, 3, 4) //Check only the four first attributes
|
||||
));
|
||||
|
||||
$this->app['Core']['EM'] = $originalEm;
|
||||
$this->app['phraseanet.core']['EM'] = $originalEm;
|
||||
|
||||
$response = $this->client->getResponse();
|
||||
|
||||
@@ -358,7 +358,7 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testAcceptElement()
|
||||
{
|
||||
$originalEm = $this->app['Core']['EM'];
|
||||
$originalEm = $this->app['phraseanet.core']['EM'];
|
||||
|
||||
//mock Doctrine\ORM\EntityManager
|
||||
$em = $this->getMock('Doctrine\ORM\EntityManager', array(), array(), '', false);
|
||||
@@ -423,13 +423,13 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
$em->expects($this->once())
|
||||
->method('flush');
|
||||
|
||||
$this->app['Core']['EM'] = $em;
|
||||
$this->app['phraseanet.core']['EM'] = $em;
|
||||
|
||||
$this->client->request('POST', '/lazaret/' . $id . '/accept/', array(
|
||||
'record_id' => self::$records['record_1']->get_record_id()
|
||||
));
|
||||
|
||||
$this->app['Core']['EM'] = $originalEm;
|
||||
$this->app['phraseanet.core']['EM'] = $originalEm;
|
||||
|
||||
$response = $this->client->getResponse();
|
||||
$content = json_decode($response->getContent());
|
||||
@@ -445,7 +445,7 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testAcceptElementNoRecordException()
|
||||
{
|
||||
$originalEm = $this->app['Core']['EM'];
|
||||
$originalEm = $this->app['phraseanet.core']['EM'];
|
||||
|
||||
//mock Doctrine\ORM\EntityManager
|
||||
$em = $this->getMock('Doctrine\ORM\EntityManager', array(), array(), '', false);
|
||||
@@ -470,13 +470,13 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
|
||||
$id = 1;
|
||||
|
||||
$this->app['Core']['EM'] = $em;
|
||||
$this->app['phraseanet.core']['EM'] = $em;
|
||||
|
||||
$this->client->request('POST', '/lazaret/' . $id . '/accept/', array(
|
||||
'record_id' => self::$records['record_1']->get_record_id()
|
||||
));
|
||||
|
||||
$this->app['Core']['EM'] = $originalEm;
|
||||
$this->app['phraseanet.core']['EM'] = $originalEm;
|
||||
|
||||
$response = $this->client->getResponse();
|
||||
|
||||
@@ -506,7 +506,7 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testAcceptElementBadRequestException()
|
||||
{
|
||||
$originalEm = $this->app['Core']['EM'];
|
||||
$originalEm = $this->app['phraseanet.core']['EM'];
|
||||
|
||||
//mock Doctrine\ORM\EntityManager
|
||||
$em = $this->getMock('Doctrine\ORM\EntityManager', array(), array(), '', false);
|
||||
@@ -521,12 +521,12 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
->with($this->EqualTo('Entities\LazaretFile'), $this->EqualTo($id))
|
||||
->will($this->returnValue($lazaretFile));
|
||||
|
||||
$this->app['Core']['EM'] = $em;
|
||||
$this->app['phraseanet.core']['EM'] = $em;
|
||||
|
||||
//Ommit record_id mandatory param
|
||||
$this->client->request('POST', '/lazaret/' . $id . '/accept/');
|
||||
|
||||
$this->app['Core']['EM'] = $originalEm;
|
||||
$this->app['phraseanet.core']['EM'] = $originalEm;
|
||||
|
||||
$response = $this->client->getResponse();
|
||||
|
||||
@@ -541,7 +541,7 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
*/
|
||||
public function testThumbnailElement()
|
||||
{
|
||||
$originalEm = $this->app['Core']['EM'];
|
||||
$originalEm = $this->app['phraseanet.core']['EM'];
|
||||
|
||||
//mock Doctrine\ORM\EntityManager
|
||||
$em = $this->getMock('Doctrine\ORM\EntityManager', array(), array(), '', false);
|
||||
@@ -566,11 +566,11 @@ class LazaretTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
->with($this->EqualTo('Entities\LazaretFile'), $this->EqualTo($id))
|
||||
->will($this->returnValue($lazaretFile));
|
||||
|
||||
$this->app['Core']['EM'] = $em;
|
||||
$this->app['phraseanet.core']['EM'] = $em;
|
||||
|
||||
$this->client->request('GET', '/lazaret/' . $id . '/thumbnail/');
|
||||
|
||||
$this->app['Core']['EM'] = $originalEm;
|
||||
$this->app['phraseanet.core']['EM'] = $originalEm;
|
||||
|
||||
$response = $this->client->getResponse();
|
||||
|
||||
|
@@ -9,10 +9,10 @@ class ControllerUsrListsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
public function createApplication()
|
||||
{
|
||||
$app = require __DIR__ . '/../../../../../lib/Alchemy/Phrasea/Application/Prod.php';
|
||||
|
||||
|
||||
$app['debug'] = true;
|
||||
unset($app['exception_handler']);
|
||||
|
||||
|
||||
return $app;
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ class ControllerUsrListsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
$this->client->request('GET', $route, array(), array(), array("HTTP_CONTENT_TYPE" => "application/json", "HTTP_ACCEPT" => "application/json"));
|
||||
|
||||
$response = $this->client->getResponse();
|
||||
|
||||
var_dump($response->getContent());
|
||||
$this->assertEquals(200, $response->getStatusCode());
|
||||
$this->assertEquals('UTF-8', $response->getCharset());
|
||||
|
||||
|
@@ -2,15 +2,12 @@
|
||||
|
||||
namespace Alchemy\Phrasea\Application;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Alchemy\Phrasea\Application as PhraseaApplication;
|
||||
use Alchemy\Phrasea\Controller\Setup as Controller;
|
||||
use Alchemy\Phrasea\Controller\Utils as ControllerUtils;
|
||||
|
||||
return call_user_func(function() {
|
||||
$app = new \Silex\Application();
|
||||
|
||||
$app['phraseanet.core'] = \bootstrap::getCore();
|
||||
$app = new PhraseaApplication();
|
||||
|
||||
$app['install'] = true;
|
||||
|
||||
|
@@ -2,13 +2,12 @@
|
||||
|
||||
namespace Alchemy\Phrasea\Application;
|
||||
|
||||
use Alchemy\Phrasea\Application as PhraseaApplication;
|
||||
use Alchemy\Phrasea\Controller\Setup as Controller;
|
||||
use Alchemy\Phrasea\Controller\Utils as ControllerUtils;
|
||||
|
||||
return call_user_func(function() {
|
||||
$app = new \Silex\Application();
|
||||
|
||||
$app['phraseanet.core'] = \bootstrap::getCore();
|
||||
$app = new PhraseaApplication();
|
||||
|
||||
$app['upgrade'] = true;
|
||||
|
||||
|
Reference in New Issue
Block a user