diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Admin/DescriptionTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Admin/DescriptionTest.php index e558a25265..0eb1821071 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Admin/DescriptionTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Admin/DescriptionTest.php @@ -44,7 +44,7 @@ class DescriptionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract */ public function testRouteDescription() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $databox = array_shift($appbox->get_databoxes()); $name = "testtest" . uniqid(); $field = \databox_field::create($databox, $name); @@ -70,7 +70,7 @@ class DescriptionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testPostDelete() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $databox = array_shift($appbox->get_databoxes()); $name = "test" . uniqid(); $field = \databox_field::create($databox, $name); @@ -96,7 +96,7 @@ class DescriptionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testPostCreate() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $databox = array_shift($appbox->get_databoxes()); $name = 'test' . uniqid(); @@ -127,7 +127,7 @@ class DescriptionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testPostDescriptionException() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $databox = array_shift($appbox->get_databoxes()); $this->client->request("POST", "/description/" . $databox->get_sbas_id() . "/", array( @@ -231,7 +231,7 @@ class DescriptionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testPostDescriptionRights() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $session = $appbox->get_session(); $auth = new Session_Authentication_None(self::$user_alt1); @@ -262,7 +262,7 @@ class DescriptionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testGetDescriptionException() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $session = $appbox->get_session(); $auth = new Session_Authentication_None(self::$user_alt1); @@ -277,7 +277,7 @@ class DescriptionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testGetDescription() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $databox = array_shift($appbox->get_databoxes()); $this->client->request("GET", "/description/" . $databox->get_sbas_id() . "/"); diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Admin/FieldsTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Admin/FieldsTest.php index 2d400bba23..398a7c8776 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Admin/FieldsTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Admin/FieldsTest.php @@ -44,7 +44,7 @@ class ControllerFieldsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract */ public function testCheckMulti() { - $appbox = \appbox::get_instance(); + $appbox = \appbox::get_instance(\bootstrap::getCore()); $databox = array_shift($appbox->get_databoxes()); $field = \databox_field::create($databox, "test" . time()); @@ -64,7 +64,7 @@ class ControllerFieldsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testCheckReadOnly() { - $appbox = \appbox::get_instance(); + $appbox = \appbox::get_instance(\bootstrap::getCore()); $databox = array_shift($appbox->get_databoxes()); $field = \databox_field::create($databox, "test" . time()); diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Admin/PublicationTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Admin/PublicationTest.php index 09ca42cdb1..7683c1d852 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Admin/PublicationTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Admin/PublicationTest.php @@ -38,7 +38,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica $crawler = $this->client->request('GET', '/publications/list/'); $pageContent = $this->client->getResponse()->getContent(); $this->assertTrue($this->client->getResponse()->isOk()); - $feeds = Feed_Collection::load_all(appbox::get_instance(), self::$user); + $feeds = Feed_Collection::load_all(appbox::get_instance(\bootstrap::getCore()), self::$user); foreach ($feeds->get_feeds() as $feed) { @@ -52,7 +52,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica public function testCreate() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); foreach ($appbox->get_databoxes() as $databox) { @@ -69,7 +69,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica $this->assertTrue($this->client->getResponse()->isRedirect('/admin/publications/list/')); - $feeds = Feed_Collection::load_all(appbox::get_instance(), self::$user); + $feeds = Feed_Collection::load_all(appbox::get_instance(\bootstrap::getCore()), self::$user); $count_after = sizeof($feeds->get_feeds()); $this->assertGreaterThan($count, $count_after); @@ -80,7 +80,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica public function testGetFeed() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou'); $crawler = $this->client->request('GET', '/publications/feed/' . $feed->get_id() . '/'); $this->assertTrue($this->client->getResponse()->isOk()); @@ -93,7 +93,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica public function testUpdateFeedNotOwner() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); //is not owner $stub = $this->getMock("user_adapter", array(), array(), "", false); //return a different userid @@ -112,7 +112,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica public function testUpdatedFeedException() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou'); @@ -140,7 +140,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica public function testUpdatedFeedOwner() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou'); @@ -178,7 +178,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica public function testIconUploadErrorOwner() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); //is not owner $stub = $this->getMock("user_adapter", array(), array(), "", false); @@ -199,7 +199,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica public function testIconUploadErrorFileData() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou'); @@ -218,7 +218,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica public function testIconUploadErrorFileType() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou'); @@ -237,7 +237,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica public function testIconUploadErrorTooLarge() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou'); @@ -256,7 +256,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica public function testIconUploadErrorNotSquareA() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou'); @@ -275,7 +275,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica public function testIconUploadErrorNotSquareB() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou'); @@ -294,7 +294,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica public function testIconUpload() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou'); @@ -326,7 +326,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica public function testAddPublisher() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou'); @@ -352,7 +352,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica public function testAddPublisherException() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou'); @@ -372,7 +372,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica public function testRemovePublisher() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou'); @@ -398,7 +398,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica public function testRemovePublisherException() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou'); @@ -420,7 +420,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica public function testDeleteFeed() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou'); diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Admin/SubdefsTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Admin/SubdefsTest.php index ad16c88d35..58301ce063 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Admin/SubdefsTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Admin/SubdefsTest.php @@ -44,7 +44,7 @@ class ControllerSubdefsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract */ public function testRouteGetSubdef() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $databox = array_shift($appbox->get_databoxes()); $this->client->request("GET", "/subdefs/" . $databox->get_sbas_id() . "/"); $this->assertTrue($this->client->getResponse()->isOk()); @@ -52,7 +52,7 @@ class ControllerSubdefsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testPostRouteAddSubdef() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $databox = array_shift($appbox->get_databoxes()); $this->client->request("POST", "/subdefs/" . $databox->get_sbas_id() . "/", array('add_subdef' => array( 'class' => 'thumbnail', @@ -67,7 +67,7 @@ class ControllerSubdefsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testPostRouteDeleteSubdef() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $databox = array_shift($appbox->get_databoxes()); $subdefs = $databox->get_subdef_structure(); $subdefs->add_subdef("image", "name", "class"); @@ -86,7 +86,7 @@ class ControllerSubdefsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testPostRouteAddSubdefWithNoParams() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $databox = array_shift($appbox->get_databoxes()); $subdefs = $databox->get_subdef_structure(); $subdefs->add_subdef("image", "name", "class"); diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Admin/UsersTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Admin/UsersTest.php index ff586db044..d70e43c6e3 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Admin/UsersTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Admin/UsersTest.php @@ -57,7 +57,7 @@ class ControllerUsersTest extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testRouteDelete() { - $appbox = \appbox::get_instance(); + $appbox = \appbox::get_instance(\bootstrap::getCore()); $username = uniqid('user_'); $user = User_Adapter::create($appbox, $username, "test", $username . "@email.com", false); @@ -80,7 +80,7 @@ class ControllerUsersTest extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testRouteRightsApply() { - $appbox = \appbox::get_instance(); + $appbox = \appbox::get_instance(\bootstrap::getCore()); $username = uniqid('user_'); $user = User_Adapter::create($appbox, $username, "test", $username . "@email.com", false); @@ -107,7 +107,7 @@ class ControllerUsersTest extends \PhraseanetWebTestCaseAuthenticatedAbstract { $this->markTestIncomplete(); $_GET = array(); - $appbox = \appbox::get_instance(); + $appbox = \appbox::get_instance(\bootstrap::getCore()); $username = uniqid('user_'); $user = User_Adapter::create($appbox, $username, "test", $username . "@email.com", false); $base_id = self::$collection->get_base_id(); @@ -158,7 +158,7 @@ class ControllerUsersTest extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testRouteRightTimeApply() { - $appbox = \appbox::get_instance(); + $appbox = \appbox::get_instance(\bootstrap::getCore()); $username = uniqid('user_'); $user = User_Adapter::create($appbox, $username, "test", $username . "@email.com", false); $base_id = self::$collection->get_base_id(); @@ -221,7 +221,7 @@ class ControllerUsersTest extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testRouteApplyTp() { - $appbox = \appbox::get_instance(); + $appbox = \appbox::get_instance(\bootstrap::getCore()); $templateName = uniqid('template_'); $template = User_Adapter::create($appbox, $templateName, "test", $templateName . "@email.com", false); @@ -266,7 +266,7 @@ class ControllerUsersTest extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testRouteCreateUser() { - $appbox = \appbox::get_instance(); + $appbox = \appbox::get_instance(\bootstrap::getCore()); $username = uniqid('user_'); $user = User_Adapter::create($appbox, $username, "test", $username . "@email.com", false); diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BasketTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BasketTest.php index 4027588e7c..79db2149be 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BasketTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BasketTest.php @@ -518,6 +518,10 @@ class ControllerBasketTest extends PhraseanetWebTestCaseAuthenticatedAbstract $this->assertEquals(200, $response->getStatusCode()); + $datas = json_decode($response->getContent()); + + $this->assertTrue($datas->success); + $em = self::$core->getEntityManager(); /* @var $em \Doctrine\ORM\EntityManager */ diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BridgeTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BridgeTest.php index db75158d56..60766c80da 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BridgeTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/BridgeTest.php @@ -30,20 +30,20 @@ class BridgeApplication extends PhraseanetWebTestCaseAuthenticatedAbstract $this->client = $this->createClient(); try { - self::$api = Bridge_Api::get_by_api_name(appbox::get_instance(), 'apitest'); + self::$api = Bridge_Api::get_by_api_name(appbox::get_instance(\bootstrap::getCore()), 'apitest'); } catch (Bridge_Exception_ApiNotFound $e) { - self::$api = Bridge_Api::create(appbox::get_instance(), 'apitest'); + self::$api = Bridge_Api::create(appbox::get_instance(\bootstrap::getCore()), 'apitest'); } try { - self::$account = Bridge_Account::load_account_from_distant_id(appbox::get_instance(), self::$api, self::$user, 'kirikoo'); + self::$account = Bridge_Account::load_account_from_distant_id(appbox::get_instance(\bootstrap::getCore()), self::$api, self::$user, 'kirikoo'); } catch (Bridge_Exception_AccountNotFound $e) { - self::$account = Bridge_Account::create(appbox::get_instance(), self::$api, self::$user, 'kirikoo', 'coucou'); + self::$account = Bridge_Account::create(appbox::get_instance(\bootstrap::getCore()), self::$api, self::$user, 'kirikoo', 'coucou'); } } @@ -66,7 +66,7 @@ class BridgeApplication extends PhraseanetWebTestCaseAuthenticatedAbstract */ public function testManager() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $accounts = Bridge_Account::get_accounts_by_user($appbox, self::$user); $usr_id = self::$user->get_id(); @@ -87,7 +87,7 @@ class BridgeApplication extends PhraseanetWebTestCaseAuthenticatedAbstract public function testCallBackFailed() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $session = $appbox->get_session(); $crawler = $this->client->request('GET', '/bridge/callback/unknow_api/'); $this->assertTrue($this->client->getResponse()->isOk()); @@ -95,7 +95,7 @@ class BridgeApplication extends PhraseanetWebTestCaseAuthenticatedAbstract public function testCallBackAccountAlreadyDefined() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $crawler = $this->client->request('GET', '/bridge/callback/apitest/'); $this->assertTrue($this->client->getResponse()->isOk()); $pageContent = $this->client->getResponse()->getContent(); @@ -145,7 +145,7 @@ class BridgeApplication extends PhraseanetWebTestCaseAuthenticatedAbstract }); try { - self::$account = Bridge_Account::load_account_from_distant_id(appbox::get_instance(), self::$api, self::$user, 'kirikoo'); + self::$account = Bridge_Account::load_account_from_distant_id(appbox::get_instance(\bootstrap::getCore()), self::$api, self::$user, 'kirikoo'); $settings = self::$account->get_settings(); $this->assertEquals("kikoo", $settings->get("auth_token")); $this->assertEquals("kooki", $settings->get("refresh_token")); @@ -160,7 +160,7 @@ class BridgeApplication extends PhraseanetWebTestCaseAuthenticatedAbstract } if (!self::$account instanceof Bridge_Account) - self::$account = Bridge_Account::create(appbox::get_instance(), self::$api, self::$user, 'kirikoo', 'coucou'); + self::$account = Bridge_Account::create(appbox::get_instance(\bootstrap::getCore()), self::$api, self::$user, 'kirikoo', 'coucou'); } public function testLogoutDeconnected() @@ -186,7 +186,7 @@ class BridgeApplication extends PhraseanetWebTestCaseAuthenticatedAbstract { self::$account->get_settings()->set("auth_token", "somethingNotNull"); //connected $url = sprintf("/bridge/adapter/%s/load-elements/%s/", self::$account->get_id(), self::$account->get_api()->get_connector()->get_default_element_type()); - $account = new Bridge_Account(appbox::get_instance(), self::$api, self::$account->get_id()); + $account = new Bridge_Account(appbox::get_instance(\bootstrap::getCore()), self::$api, self::$account->get_id()); $crawler = $this->client->request('GET', $url, array("page" => 1)); $this->assertTrue($this->client->getResponse()->isOk()); $this->assertNotContains(self::$account->get_api()->generate_login_url(registry::get_instance(), self::$account->get_api()->get_connector()->get_name()), $this->client->getResponse()->getContent()); @@ -207,7 +207,7 @@ class BridgeApplication extends PhraseanetWebTestCaseAuthenticatedAbstract self::$account->get_settings()->set("auth_token", "somethingNotNull"); //connected $url = sprintf("/bridge/adapter/%s/load-records/", self::$account->get_id()); $crawler = $this->client->request('GET', $url, array("page" => 1)); - $elements = Bridge_Element::get_elements_by_account(appbox::get_instance(), self::$account); + $elements = Bridge_Element::get_elements_by_account(appbox::get_instance(\bootstrap::getCore()), self::$account); $this->assertTrue($this->client->getResponse()->isOk()); $this->assertEquals(sizeof($elements), $crawler->filterXPath("//table/tr")->count()); $this->assertNotContains(self::$account->get_api()->generate_login_url(registry::get_instance(), self::$account->get_api()->get_connector()->get_name()), $this->client->getResponse()->getContent()); @@ -228,7 +228,7 @@ class BridgeApplication extends PhraseanetWebTestCaseAuthenticatedAbstract self::$account->get_settings()->set("auth_token", "somethingNotNull"); //connected $url = sprintf("/bridge/adapter/%s/load-containers/%s/", self::$account->get_id(), self::$account->get_api()->get_connector()->get_default_container_type()); $crawler = $this->client->request('GET', $url, array("page" => 1)); - $elements = Bridge_Element::get_elements_by_account(appbox::get_instance(), self::$account); + $elements = Bridge_Element::get_elements_by_account(appbox::get_instance(\bootstrap::getCore()), self::$account); $this->assertTrue($this->client->getResponse()->isOk()); $this->assertNotContains(self::$account->get_api()->generate_login_url(registry::get_instance(), self::$account->get_api()->get_connector()->get_name()), $this->client->getResponse()->getContent()); } diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/FeedTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/FeedTest.php index a294771f3d..30388f53e4 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/FeedTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/FeedTest.php @@ -57,7 +57,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract { parent::setUp(); - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $this->client = $this->createClient(); @@ -107,7 +107,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testRequestAvailable() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $crawler = $this->client->request('POST', '/feeds/requestavailable/'); $this->assertTrue($this->client->getResponse()->isOk()); $feeds = Feed_Collection::load_all($appbox, self::$user); @@ -161,7 +161,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testEntryEdit() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $crawler = $this->client->request('GET', '/feeds/entry/' . $this->entry->get_id() . '/edit/'); $pageContent = $this->client->getResponse()->getContent(); @@ -180,7 +180,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testEntryEditUnauthorized() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $feed = Feed_Adapter::create( $appbox, self::$user_alt1, $this->feed_title, $this->feed_subtitle @@ -212,7 +212,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testEntryUpdate() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $params = array( "feed_id" => $this->feed->get_id() @@ -236,7 +236,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testEntryUpdateNotFound() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $params = array( "feed_id" => 9999999 @@ -262,7 +262,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testEntryUpdateFailed() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $params = array( "feed_id" => 9999999 @@ -288,7 +288,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testEntryUpdateUnauthorized() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); /** * I CREATE A FEED THAT IS NOT MINE * */ @@ -323,7 +323,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testDelete() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $crawler = $this->client->request('POST', '/feeds/entry/' . $this->entry->get_id() . '/delete/'); @@ -349,7 +349,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testDeleteNotFound() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $crawler = $this->client->request('POST', '/feeds/entry/9999999/delete/'); @@ -366,7 +366,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testDeleteUnauthorized() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); /** * I CREATE A FEED * */ @@ -393,7 +393,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testRoot() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $crawler = $this->client->request('GET', '/feeds/'); @@ -422,7 +422,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testGetFeed() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $feeds = Feed_Collection::load_all($appbox, self::$user); @@ -448,7 +448,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testSuscribeAggregate() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $feeds = Feed_Collection::load_all($appbox, self::$user); $crawler = $this->client->request('GET', '/feeds/subscribe/aggregated/'); $this->assertTrue($this->client->getResponse()->isOk()); diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/TooltipTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/TooltipTest.php index 04dfe349fa..2f493d8fb7 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Prod/TooltipTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Prod/TooltipTest.php @@ -28,7 +28,7 @@ class ControllerTooltipTest extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testRouteBasket() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $basket = $this->insertOneBasket(); diff --git a/lib/unitTest/Alchemy/Phrasea/Controller/Root/RSSFeedTest.php b/lib/unitTest/Alchemy/Phrasea/Controller/Root/RSSFeedTest.php index f16236db4c..1d950e5fde 100644 --- a/lib/unitTest/Alchemy/Phrasea/Controller/Root/RSSFeedTest.php +++ b/lib/unitTest/Alchemy/Phrasea/Controller/Root/RSSFeedTest.php @@ -80,11 +80,11 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract { parent::setUp(); $this->client = $this->createClient(); - self::$feed = Feed_Adapter::create(appbox::get_instance(), self::$user, 'title', 'subtitle'); - self::$publisher = Feed_Publisher_Adapter::getPublisher(appbox::get_instance(), self::$feed, self::$user); - self::$entry = Feed_Entry_Adapter::create(appbox::get_instance(), self::$feed, self::$publisher, 'title_entry', 'subtitle', 'hello', "test@mail.com"); - Feed_Entry_Item::create(appbox::get_instance(), self::$entry, self::$record_1); - Feed_Entry_Item::create(appbox::get_instance(), self::$entry, self::$record_2); + self::$feed = Feed_Adapter::create(appbox::get_instance(\bootstrap::getCore()), self::$user, 'title', 'subtitle'); + self::$publisher = Feed_Publisher_Adapter::getPublisher(appbox::get_instance(\bootstrap::getCore()), self::$feed, self::$user); + self::$entry = Feed_Entry_Adapter::create(appbox::get_instance(\bootstrap::getCore()), self::$feed, self::$publisher, 'title_entry', 'subtitle', 'hello', "test@mail.com"); + Feed_Entry_Item::create(appbox::get_instance(\bootstrap::getCore()), self::$entry, self::$record_1); + Feed_Entry_Item::create(appbox::get_instance(\bootstrap::getCore()), self::$entry, self::$record_2); self::$feed->set_public(true); } @@ -109,7 +109,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract { parent::setUpBeforeClass(); - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $auth = new Session_Authentication_None(self::$user); $appbox->get_session()->authenticate($auth); @@ -244,7 +244,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract //$app->get('/feeds/feed/{id}/{format}/', function($id, $format) use ($app, $appbox, $display_feed) public function testPublicFeed() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $auth = new Session_Authentication_None(self::$user); $appbox->get_session()->authenticate($auth); @@ -265,7 +265,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract //$app->get('/feeds/userfeed/aggregated/{token}/{format}/', function($token, $format) use ($app, $appbox, $display_feed) public function testUserFeedAggregated() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $auth = new Session_Authentication_None(self::$user); $appbox->get_session()->authenticate($auth); @@ -286,7 +286,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract //$app->get('/feeds/userfeed/{token}/{id}/{format}/', function($token, $id, $format) use ($app, $appbox, $display_feed) public function testUserFeed() { - $appbox = appbox::get_instance(); + $appbox = appbox::get_instance(\bootstrap::getCore()); $auth = new Session_Authentication_None(self::$user); $appbox->get_session()->authenticate($auth); @@ -306,7 +306,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract public function testGetFeedFormat() { - $feeds = Feed_Collection::load_public_feeds(appbox::get_instance()); + $feeds = Feed_Collection::load_public_feeds(appbox::get_instance(\bootstrap::getCore())); $feed = array_shift($feeds->get_feeds()); $crawler = $this->client->request("GET", "/feeds/feed/" . $feed->get_id() . "/rss/"); @@ -334,7 +334,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract public function testAggregatedRss() { - $feeds = Feed_Collection::load_public_feeds(appbox::get_instance()); + $feeds = Feed_Collection::load_public_feeds(appbox::get_instance(\bootstrap::getCore())); $all_feeds = $feeds->get_feeds(); foreach ($all_feeds as $feed) { @@ -349,7 +349,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract public function testAggregatedAtom() { - $feeds = Feed_Collection::load_public_feeds(appbox::get_instance()); + $feeds = Feed_Collection::load_public_feeds(appbox::get_instance(\bootstrap::getCore())); $all_feeds = $feeds->get_feeds(); foreach ($all_feeds as $feed) { @@ -374,7 +374,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract public function testGetFeedId() { - $feeds = Feed_Collection::load_public_feeds(appbox::get_instance()); + $feeds = Feed_Collection::load_public_feeds(appbox::get_instance(\bootstrap::getCore())); $all_feeds = $feeds->get_feeds(); $feed = array_shift($all_feeds); @@ -392,7 +392,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract public function testPrivateFeedAccess() { - $private_feed = Feed_Adapter::create(appbox::get_instance(), self::$user, 'title', 'subtitle'); + $private_feed = Feed_Adapter::create(appbox::get_instance(\bootstrap::getCore()), self::$user, 'title', 'subtitle'); $private_feed->set_public(false); $this->client->request("GET", "/feeds/feed/" . $private_feed->get_id() . "/rss/"); $this->assertFalse($this->client->getResponse()->isOk());