diff --git a/lib/unitTest/ACLTest.php b/lib/unitTest/ACLTest.php index b907c81cb9..88ea8c9071 100644 --- a/lib/unitTest/ACLTest.php +++ b/lib/unitTest/ACLTest.php @@ -29,7 +29,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract $usr_id = User_Adapter::get_usr_id_from_login('test_phpunit2'); try { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $template = User_Adapter::getInstance($usr_id, $appbox); $template->delete(); } @@ -40,7 +40,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract $usr_id = User_Adapter::get_usr_id_from_login('test_phpunit3'); try { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $cobaye = User_Adapter::getInstance($usr_id, $appbox); $cobaye->delete(); } @@ -53,7 +53,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testApply_model() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $template = User_Adapter::create($appbox, 'test_phpunit2', 'blabla2', 'test2@example.com', false); $template->set_template(self::$user); @@ -85,7 +85,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testRevoke_access_from_bases() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $base_ids = array(); foreach ($appbox->get_databoxes() as $databox) @@ -110,7 +110,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testGive_access_to_base() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); foreach ($appbox->get_databoxes() as $databox) { @@ -126,7 +126,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testGive_access_to_sbas() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); foreach ($appbox->get_databoxes() as $databox) { @@ -147,7 +147,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testRevoke_unused_sbas_rights() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); foreach ($appbox->get_databoxes() as $databox) { $sbas_id = $databox->get_sbas_id(); @@ -172,7 +172,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testSet_quotas_on_base() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); foreach ($appbox->get_databoxes() as $databox) { foreach ($databox->get_collections() as $collection) @@ -195,7 +195,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testDuplicate_right_from_bas() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $first = true; $base_ref = null; @@ -238,7 +238,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testHas_right_on_base() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $rights_false = array( 'imgtools' => false @@ -287,7 +287,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testRemaining_download() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); foreach ($appbox->get_databoxes() as $databox) { foreach ($databox->get_collections() as $collection) @@ -310,7 +310,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testRemove_remaining() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); foreach ($appbox->get_databoxes() as $databox) { foreach ($databox->get_collections() as $collection) @@ -339,7 +339,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testHas_right() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $rights = array( @@ -363,7 +363,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testHas_right_on_sbas() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $rights_false = array( 'bas_modify_struct' => false @@ -403,7 +403,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testGet_mask_and() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); foreach ($appbox->get_databoxes() as $databox) { foreach ($databox->get_collections() as $collection) @@ -427,7 +427,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testGet_mask_xor() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); foreach ($appbox->get_databoxes() as $databox) { foreach ($databox->get_collections() as $collection) @@ -451,7 +451,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testHas_access_to_base() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $base_ids = array(); $n = 0; foreach ($appbox->get_databoxes() as $databox) @@ -512,7 +512,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testGet_granted_base() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $base_ids = array(); $n = 0; foreach ($appbox->get_databoxes() as $databox) @@ -551,7 +551,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testGet_granted_sbas() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $sbas_ids = array(); $n = 0; foreach ($appbox->get_databoxes() as $databox) @@ -583,7 +583,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testHas_access_to_module() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); foreach ($appbox->get_databoxes() as $databox) { @@ -654,7 +654,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testis_limited() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $found = false; @@ -703,7 +703,7 @@ class ACLTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testget_limits() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $found = false; diff --git a/lib/unitTest/PhraseanetPHPUnitAbstract.class.inc b/lib/unitTest/PhraseanetPHPUnitAbstract.class.inc index aa0accb75e..1f62fd4227 100644 --- a/lib/unitTest/PhraseanetPHPUnitAbstract.class.inc +++ b/lib/unitTest/PhraseanetPHPUnitAbstract.class.inc @@ -823,12 +823,13 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase $serviceName = $configuration->getTemplating(); $confService = $configuration->getService($serviceName); - $templateServiceBuilder = new \Alchemy\Phrasea\Core\ServiceBuilder\TemplateEngine( + $templateServiceBuilder = \Alchemy\Phrasea\Core\Service\Builder::create( + self::$core, $serviceName , $confService ); - $this->app['Core']["Twig"] = $templateServiceBuilder->buildService()->getService(); + $this->app['Core']["Twig"] = $templateServiceBuilder->getService(); } /** @@ -837,7 +838,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase */ private static function updateTablesSchema() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); if (!self::$updated) { @@ -889,7 +890,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase */ private static function createSetOfUserTests() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $usr_id = User_Adapter::get_usr_id_from_login('test_phpunit'); $usr_alt1_id = User_Adapter::get_usr_id_from_login('test_phpunit_alt1'); @@ -925,7 +926,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase */ private static function giveRightsToUser(\User_Adapter $user) { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $user->ACL()->give_access_to_sbas(array_keys($appbox->get_databoxes())); @@ -979,7 +980,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase */ private static function setCollection() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $coll = $collection_no_acces = null; foreach ($appbox->get_databoxes() as $databox) diff --git a/lib/unitTest/PhraseanetPHPUnitAuthenticatedAbstract.class.inc b/lib/unitTest/PhraseanetPHPUnitAuthenticatedAbstract.class.inc index 933fd4fd37..740afc2a77 100644 --- a/lib/unitTest/PhraseanetPHPUnitAuthenticatedAbstract.class.inc +++ b/lib/unitTest/PhraseanetPHPUnitAuthenticatedAbstract.class.inc @@ -27,7 +27,7 @@ abstract class PhraseanetPHPUnitAuthenticatedAbstract extends PhraseanetPHPUnitA public function setUp() { parent::setUp(); - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $session = $appbox->get_session(); $auth = new Session_Authentication_None(self::$user); $session->authenticate($auth); @@ -35,7 +35,7 @@ abstract class PhraseanetPHPUnitAuthenticatedAbstract extends PhraseanetPHPUnitA public function tearDown() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $session = $appbox->get_session(); $session->logout(); parent::tearDown(); diff --git a/lib/unitTest/PhraseanetWebTestCaseAuthenticatedAbstract.class.inc b/lib/unitTest/PhraseanetWebTestCaseAuthenticatedAbstract.class.inc index 01b8e4037f..4d0e5d24b1 100644 --- a/lib/unitTest/PhraseanetWebTestCaseAuthenticatedAbstract.class.inc +++ b/lib/unitTest/PhraseanetWebTestCaseAuthenticatedAbstract.class.inc @@ -27,7 +27,7 @@ abstract class PhraseanetWebTestCaseAuthenticatedAbstract extends PhraseanetPHPU public static function setUpBeforeClass() { parent::setUpBeforeClass(); - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $session = $appbox->get_session(); $auth = new Session_Authentication_None(self::$user); $session->authenticate($auth); @@ -36,7 +36,7 @@ abstract class PhraseanetWebTestCaseAuthenticatedAbstract extends PhraseanetPHPU public static function tearDownAfterClass() { parent::tearDownAfterClass(); - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $session = $appbox->get_session(); $session->logout(); } diff --git a/lib/unitTest/collectionTest.php b/lib/unitTest/collectionTest.php index 043d021722..d3737da30e 100644 --- a/lib/unitTest/collectionTest.php +++ b/lib/unitTest/collectionTest.php @@ -17,7 +17,7 @@ class collectionTest extends PhraseanetPHPUnitAuthenticatedAbstract public static function setUpBeforeClass() { parent::setUpBeforeClass(); - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $auth = new Session_Authentication_None(self::$user); $appbox->get_session()->authenticate($auth); @@ -46,7 +46,7 @@ class collectionTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testEnable() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $base_id = self::$object->get_base_id(); $coll_id = self::$object->get_coll_id(); self::$object->disable($appbox); diff --git a/lib/unitTest/record/adapterTest.php b/lib/unitTest/record/adapterTest.php index d70067bbc6..3a62561a1d 100644 --- a/lib/unitTest/record/adapterTest.php +++ b/lib/unitTest/record/adapterTest.php @@ -177,7 +177,7 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract public function testGet_mime() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $found = $coll = false; foreach ($appbox->get_databoxes() as $databox) { @@ -525,7 +525,7 @@ class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract */ public function testGet_container_baskets() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $usr_id = $appbox->get_session()->get_usr_id(); $em = self::$core->getEntityManager(); diff --git a/lib/unitTest/report/activityTest.php b/lib/unitTest/report/activityTest.php index b8481b89c5..38f56c0d6e 100644 --- a/lib/unitTest/report/activityTest.php +++ b/lib/unitTest/report/activityTest.php @@ -35,7 +35,7 @@ class activityTest extends PhraseanetPHPUnitAbstract $this->dmax = $date->format("Y-m-d H:i:s"); $date->modify('-6 month'); $this->dmin = $date->format("Y-m-d H:i:s"); - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $databoxes = $appbox->get_databoxes(); $this->ret = array(); foreach ($databoxes as $databox) diff --git a/lib/unitTest/report/addTest.php b/lib/unitTest/report/addTest.php index 8199e8b56a..6e7e671b74 100644 --- a/lib/unitTest/report/addTest.php +++ b/lib/unitTest/report/addTest.php @@ -31,7 +31,7 @@ class addReportTest extends PhraseanetPHPUnitAbstract $this->dmax = $date->format("Y-m-d H:i:s"); $date->modify('-6 month'); $this->dmin = $date->format("Y-m-d H:i:s"); - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $databoxes = $appbox->get_databoxes(); $this->ret = array(); foreach ($databoxes as $databox) diff --git a/lib/unitTest/report/connexionReportTest.php b/lib/unitTest/report/connexionReportTest.php index 4630126b20..c46b9e5db9 100644 --- a/lib/unitTest/report/connexionReportTest.php +++ b/lib/unitTest/report/connexionReportTest.php @@ -32,7 +32,7 @@ class connexionReportTest extends PhraseanetPHPUnitAbstract $thid->dmax = $date->format("Y-m-d H:i:s"); $date->modify('-6 month'); $this->dmin = $date->format("Y-m-d H:i:s"); - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $databoxes = $appbox->get_databoxes(); $this->ret = array(); foreach ($databoxes as $databox) diff --git a/lib/unitTest/report/downloadReportTest.php b/lib/unitTest/report/downloadReportTest.php index 6ac7751f71..795d64939f 100644 --- a/lib/unitTest/report/downloadReportTest.php +++ b/lib/unitTest/report/downloadReportTest.php @@ -31,7 +31,7 @@ class downloadReportTest extends PhraseanetPHPUnitAbstract $thid->dmax = $date->format("Y-m-d H:i:s"); $date->modify('-6 month'); $this->dmin = $date->format("Y-m-d H:i:s"); - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $databoxes = $appbox->get_databoxes(); $this->ret = array(); foreach ($databoxes as $databox) diff --git a/lib/unitTest/report/editTest.php b/lib/unitTest/report/editTest.php index ef32ddcf51..fb0869b205 100644 --- a/lib/unitTest/report/editTest.php +++ b/lib/unitTest/report/editTest.php @@ -31,7 +31,7 @@ class editTest extends PhraseanetPHPUnitAbstract $this->dmax = $date->format("Y-m-d H:i:s"); $date->modify('-6 month'); $this->dmin = $date->format("Y-m-d H:i:s"); - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $databoxes = $appbox->get_databoxes(); $this->ret = array(); foreach ($databoxes as $databox) diff --git a/lib/unitTest/report/filterTest.php b/lib/unitTest/report/filterTest.php index 4137695260..0b55ef55b6 100644 --- a/lib/unitTest/report/filterTest.php +++ b/lib/unitTest/report/filterTest.php @@ -31,7 +31,7 @@ class filterTest extends PhraseanetPHPUnitAbstract $thid->dmax = $date->format("Y-m-d H:i:s"); $date->modify('-6 month'); $this->dmin = $date->format("Y-m-d H:i:s"); - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $databoxes = $appbox->get_databoxes(); $this->ret = array(); foreach ($databoxes as $databox) diff --git a/lib/unitTest/report/pushTest.php b/lib/unitTest/report/pushTest.php index 0428a23a11..eec715b609 100644 --- a/lib/unitTest/report/pushTest.php +++ b/lib/unitTest/report/pushTest.php @@ -31,7 +31,7 @@ class pushReportTest extends PhraseanetPHPUnitAbstract $this->dmax = $date->format("Y-m-d H:i:s"); $date->modify('-6 month'); $this->dmin = $date->format("Y-m-d H:i:s"); - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $databoxes = $appbox->get_databoxes(); $this->ret = array(); foreach ($databoxes as $databox) diff --git a/lib/unitTest/report/questionReportTest.php b/lib/unitTest/report/questionReportTest.php index 573f2e1d2d..3b5ddffebb 100644 --- a/lib/unitTest/report/questionReportTest.php +++ b/lib/unitTest/report/questionReportTest.php @@ -31,7 +31,7 @@ class questionReportTest extends PhraseanetPHPUnitAbstract $thid->dmax = $date->format("Y-m-d H:i:s"); $date->modify('-6 month'); $this->dmin = $date->format("Y-m-d H:i:s"); - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $databoxes = $appbox->get_databoxes(); $this->ret = array(); foreach ($databoxes as $databox) diff --git a/lib/unitTest/report/reportTest.php b/lib/unitTest/report/reportTest.php index 53ff9c8c2c..a0dc756019 100644 --- a/lib/unitTest/report/reportTest.php +++ b/lib/unitTest/report/reportTest.php @@ -44,7 +44,7 @@ class reportTest extends PhraseanetPHPUnitAbstract $thid->dmax = $date->format("Y-m-d H:i:s"); $date->modify('-6 month'); $this->dmin = $date->format("Y-m-d H:i:s"); - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $databoxes = $appbox->get_databoxes(); $this->ret = array(); foreach ($databoxes as $databox) diff --git a/lib/unitTest/report/sqlFilterTest.php b/lib/unitTest/report/sqlFilterTest.php index 4f39b298fe..f74e031a48 100644 --- a/lib/unitTest/report/sqlFilterTest.php +++ b/lib/unitTest/report/sqlFilterTest.php @@ -34,7 +34,7 @@ class sqlFilterTest extends PhraseanetPHPUnitAbstract $dmax = $date->format("Y-m-d H:i:s"); $date->modify('-6 month'); $dmin = $date->format("Y-m-d H:i:s"); - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $databoxes = $appbox->get_databoxes(); $ret = array(); foreach ($databoxes as $databox) diff --git a/lib/unitTest/system/system_fileTest.php b/lib/unitTest/system/system_fileTest.php index 4d7bc59964..c03da5338e 100644 --- a/lib/unitTest/system/system_fileTest.php +++ b/lib/unitTest/system/system_fileTest.php @@ -238,7 +238,7 @@ class system_fileTest extends PhraseanetPHPUnitAbstract public function testExtract_metadatas() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $databox = null; foreach ($appbox->get_databoxes() as $d) { diff --git a/lib/unitTest/task/task_abstractTest.php b/lib/unitTest/task/task_abstractTest.php index 04fb87a113..57d969d2a0 100644 --- a/lib/unitTest/task/task_abstractTest.php +++ b/lib/unitTest/task/task_abstractTest.php @@ -11,7 +11,7 @@ class task_abstractTest extends PhraseanetPHPUnitAbstract public function testCreate() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $task = task_abstract::create($appbox, 'task_period_apibridge'); $task->delete();