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()
|
||||
{
|
||||
$appbox = \appbox::get_instance(\bootstrap::getCore());
|
||||
$appbox = $this->app["phraseanet.appbox"];
|
||||
|
||||
$registry = $this->getMock('\\registry', array(), array(), '', false);
|
||||
$registry
|
||||
@@ -153,13 +153,13 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
|
||||
->method('get')
|
||||
->with($this->equalTo('GV_client_navigator'))
|
||||
->will($this->returnValue(false));
|
||||
$registryBkp = $this->app["Core"]->getRegistry();
|
||||
$registryBkp = $this->app["phraseanet.core"]->getRegistry();
|
||||
|
||||
$fail = null;
|
||||
|
||||
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);
|
||||
|
||||
@@ -176,7 +176,7 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
|
||||
$fail = $e;
|
||||
}
|
||||
|
||||
$this->app["Core"]['Registry'] = $registryBkp;
|
||||
$this->app["phraseanet.core"]['Registry'] = $registryBkp;
|
||||
|
||||
if ($fail) {
|
||||
throw $fail;
|
||||
@@ -222,7 +222,7 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
|
||||
*/
|
||||
public function testGetMonitorTasks()
|
||||
{
|
||||
$appbox = \appbox::get_instance(\bootstrap::getCore());
|
||||
$appbox = $this->app["phraseanet.appbox"];
|
||||
if (null === self::$adminToken) {
|
||||
$this->markTestSkipped('there is no user with admin rights');
|
||||
}
|
||||
@@ -288,7 +288,7 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
|
||||
*/
|
||||
public function testGetMonitorTaskById()
|
||||
{
|
||||
$appbox = \appbox::get_instance(\bootstrap::getCore());
|
||||
$appbox = $this->app["phraseanet.appbox"];
|
||||
$task_manager = new \task_manager($appbox);
|
||||
$tasks = $task_manager->getTasks();
|
||||
|
||||
@@ -322,7 +322,7 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
|
||||
*/
|
||||
public function testPostMonitorTaskById()
|
||||
{
|
||||
$appbox = \appbox::get_instance(\bootstrap::getCore());
|
||||
$appbox = $this->app["phraseanet.appbox"];
|
||||
$task_manager = new \task_manager($appbox);
|
||||
$tasks = $task_manager->getTasks();
|
||||
|
||||
@@ -379,7 +379,7 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
|
||||
$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);
|
||||
$tasks = $task_manager->getTasks();
|
||||
|
||||
@@ -413,7 +413,7 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract
|
||||
*/
|
||||
public function testPostMonitorStopTask()
|
||||
{
|
||||
$appbox = \appbox::get_instance(\bootstrap::getCore());
|
||||
$appbox = $this->app["phraseanet.appbox"];
|
||||
$task_manager = new \task_manager($appbox);
|
||||
|
||||
$tasks = $task_manager->getTasks();
|
||||
|
@@ -15,7 +15,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
{
|
||||
parent::setUp();
|
||||
$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()
|
||||
@@ -266,7 +266,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
public function testSet_record_status()
|
||||
{
|
||||
$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());
|
||||
$databox = static::$records['record_1']->get_databox();
|
||||
|
||||
@@ -303,7 +303,7 @@ class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||
public function testSet_record_collection()
|
||||
{
|
||||
$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();
|
||||
|
||||
$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