mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 06:23:18 +00:00
Update APIs uses
This commit is contained in:
@@ -145,7 +145,7 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
|
|||||||
|
|
||||||
public function testCheckNativeApp()
|
public function testCheckNativeApp()
|
||||||
{
|
{
|
||||||
$appbox = \appbox::get_instance(\bootstrap::getCore());
|
$appbox = $this->app["phraseanet.appbox"];
|
||||||
|
|
||||||
$registry = $this->getMock('\\registry', array(), array(), '', false);
|
$registry = $this->getMock('\\registry', array(), array(), '', false);
|
||||||
$registry
|
$registry
|
||||||
@@ -153,13 +153,13 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
|
|||||||
->method('get')
|
->method('get')
|
||||||
->with($this->equalTo('GV_client_navigator'))
|
->with($this->equalTo('GV_client_navigator'))
|
||||||
->will($this->returnValue(false));
|
->will($this->returnValue(false));
|
||||||
$registryBkp = $this->app["Core"]->getRegistry();
|
$registryBkp = $this->app["phraseanet.core"]->getRegistry();
|
||||||
|
|
||||||
$fail = null;
|
$fail = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$this->app["Core"]['Registry'] = $registry;
|
$this->app["phraseanet.core"]['Registry'] = $registry;
|
||||||
|
|
||||||
$nativeApp = \API_OAuth2_Application::load_from_client_id($appbox, \API_OAuth2_Application_Navigator::CLIENT_ID);
|
$nativeApp = \API_OAuth2_Application::load_from_client_id($appbox, \API_OAuth2_Application_Navigator::CLIENT_ID);
|
||||||
|
|
||||||
@@ -176,7 +176,7 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
|
|||||||
$fail = $e;
|
$fail = $e;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->app["Core"]['Registry'] = $registryBkp;
|
$this->app["phraseanet.core"]['Registry'] = $registryBkp;
|
||||||
|
|
||||||
if ($fail) {
|
if ($fail) {
|
||||||
throw $fail;
|
throw $fail;
|
||||||
@@ -222,7 +222,7 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
|
|||||||
*/
|
*/
|
||||||
public function testGetMonitorTasks()
|
public function testGetMonitorTasks()
|
||||||
{
|
{
|
||||||
$appbox = \appbox::get_instance(\bootstrap::getCore());
|
$appbox = $this->app["phraseanet.appbox"];
|
||||||
if (null === self::$adminToken) {
|
if (null === self::$adminToken) {
|
||||||
$this->markTestSkipped('there is no user with admin rights');
|
$this->markTestSkipped('there is no user with admin rights');
|
||||||
}
|
}
|
||||||
@@ -288,7 +288,7 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
|
|||||||
*/
|
*/
|
||||||
public function testGetMonitorTaskById()
|
public function testGetMonitorTaskById()
|
||||||
{
|
{
|
||||||
$appbox = \appbox::get_instance(\bootstrap::getCore());
|
$appbox = $this->app["phraseanet.appbox"];
|
||||||
$task_manager = new \task_manager($appbox);
|
$task_manager = new \task_manager($appbox);
|
||||||
$tasks = $task_manager->getTasks();
|
$tasks = $task_manager->getTasks();
|
||||||
|
|
||||||
@@ -322,7 +322,7 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
|
|||||||
*/
|
*/
|
||||||
public function testPostMonitorTaskById()
|
public function testPostMonitorTaskById()
|
||||||
{
|
{
|
||||||
$appbox = \appbox::get_instance(\bootstrap::getCore());
|
$appbox = $this->app["phraseanet.appbox"];
|
||||||
$task_manager = new \task_manager($appbox);
|
$task_manager = new \task_manager($appbox);
|
||||||
$tasks = $task_manager->getTasks();
|
$tasks = $task_manager->getTasks();
|
||||||
|
|
||||||
@@ -379,7 +379,7 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
|
|||||||
$this->markTestSkipped('there is no user with admin rights');
|
$this->markTestSkipped('there is no user with admin rights');
|
||||||
}
|
}
|
||||||
|
|
||||||
$appbox = \appbox::get_instance(\bootstrap::getCore());
|
$appbox = $this->app["phraseanet.appbox"];
|
||||||
$task_manager = new \task_manager($appbox);
|
$task_manager = new \task_manager($appbox);
|
||||||
$tasks = $task_manager->getTasks();
|
$tasks = $task_manager->getTasks();
|
||||||
|
|
||||||
@@ -413,7 +413,7 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
|
|||||||
*/
|
*/
|
||||||
public function testPostMonitorStopTask()
|
public function testPostMonitorStopTask()
|
||||||
{
|
{
|
||||||
$appbox = \appbox::get_instance(\bootstrap::getCore());
|
$appbox = $this->app["phraseanet.appbox"];
|
||||||
$task_manager = new \task_manager($appbox);
|
$task_manager = new \task_manager($appbox);
|
||||||
|
|
||||||
$tasks = $task_manager->getTasks();
|
$tasks = $task_manager->getTasks();
|
||||||
|
@@ -387,7 +387,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase
|
|||||||
if (isset($parameters['expires']) && $parameters['expires'] instanceof \DateTime) {
|
if (isset($parameters['expires']) && $parameters['expires'] instanceof \DateTime) {
|
||||||
$Validation->setExpires($parameters['expires']);
|
$Validation->setExpires($parameters['expires']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$basket->setValidation($Validation);
|
$basket->setValidation($Validation);
|
||||||
$em->persist($Validation);
|
$em->persist($Validation);
|
||||||
$em->merge($basket);
|
$em->merge($basket);
|
||||||
|
@@ -15,7 +15,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$this->object = new API_V1_adapter(FALSE, $appbox, self::$core);
|
$this->object = new API_V1_adapter($appbox, self::$core);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testGet_error_code()
|
public function testGet_error_code()
|
||||||
@@ -266,7 +266,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
public function testSet_record_status()
|
public function testSet_record_status()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$stub = $this->getMock("API_V1_adapter", array("list_record_status"), array(false, &$appbox, bootstrap::getCore()));
|
$stub = $this->getMock("API_V1_adapter", array("list_record_status"), array(&$appbox, bootstrap::getCore()));
|
||||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$databox = static::$records['record_1']->get_databox();
|
$databox = static::$records['record_1']->get_databox();
|
||||||
|
|
||||||
@@ -303,7 +303,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
|||||||
public function testSet_record_collection()
|
public function testSet_record_collection()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$stub = $this->getMock("API_V1_adapter", array("list_record"), array(false, &$appbox, bootstrap::getCore()));
|
$stub = $this->getMock("API_V1_adapter", array("list_record"), array(&$appbox, bootstrap::getCore()));
|
||||||
$databox = static::$records['record_1']->get_databox();
|
$databox = static::$records['record_1']->get_databox();
|
||||||
|
|
||||||
$request = new Request(array("salut" => "salut c'est la fete"), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json'));
|
$request = new Request(array("salut" => "salut c'est la fete"), array(), array(), array(), array(), array('HTTP_Accept' => 'application/json'));
|
||||||
|
Reference in New Issue
Block a user