diff --git a/tests/Alchemy/Phrasea/Application/ApiAbstract.inc b/tests/Alchemy/Phrasea/Application/ApiAbstract.inc index 0ccae8c728..c4bf19fc4f 100644 --- a/tests/Alchemy/Phrasea/Application/ApiAbstract.inc +++ b/tests/Alchemy/Phrasea/Application/ApiAbstract.inc @@ -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(); diff --git a/tests/PhraseanetPHPUnitAbstract.class.inc b/tests/PhraseanetPHPUnitAbstract.class.inc index 704d22365f..6aa1b670b0 100644 --- a/tests/PhraseanetPHPUnitAbstract.class.inc +++ b/tests/PhraseanetPHPUnitAbstract.class.inc @@ -387,7 +387,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase if (isset($parameters['expires']) && $parameters['expires'] instanceof \DateTime) { $Validation->setExpires($parameters['expires']); } - + $basket->setValidation($Validation); $em->persist($Validation); $em->merge($basket); diff --git a/tests/api/v1/api_v1_adapterTest.php b/tests/api/v1/api_v1_adapterTest.php index 78aab66447..9e3700e5f6 100644 --- a/tests/api/v1/api_v1_adapterTest.php +++ b/tests/api/v1/api_v1_adapterTest.php @@ -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'));