mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
Refactor Appbox
This commit is contained in:
@@ -44,7 +44,7 @@ class DescriptionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
*/
|
*/
|
||||||
public function testRouteDescription()
|
public function testRouteDescription()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$databox = array_shift($appbox->get_databoxes());
|
$databox = array_shift($appbox->get_databoxes());
|
||||||
$name = "testtest" . uniqid();
|
$name = "testtest" . uniqid();
|
||||||
$field = \databox_field::create($databox, $name);
|
$field = \databox_field::create($databox, $name);
|
||||||
@@ -70,7 +70,7 @@ class DescriptionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testPostDelete()
|
public function testPostDelete()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$databox = array_shift($appbox->get_databoxes());
|
$databox = array_shift($appbox->get_databoxes());
|
||||||
$name = "test" . uniqid();
|
$name = "test" . uniqid();
|
||||||
$field = \databox_field::create($databox, $name);
|
$field = \databox_field::create($databox, $name);
|
||||||
@@ -96,7 +96,7 @@ class DescriptionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testPostCreate()
|
public function testPostCreate()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$databox = array_shift($appbox->get_databoxes());
|
$databox = array_shift($appbox->get_databoxes());
|
||||||
|
|
||||||
$name = 'test' . uniqid();
|
$name = 'test' . uniqid();
|
||||||
@@ -127,7 +127,7 @@ class DescriptionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testPostDescriptionException()
|
public function testPostDescriptionException()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$databox = array_shift($appbox->get_databoxes());
|
$databox = array_shift($appbox->get_databoxes());
|
||||||
|
|
||||||
$this->client->request("POST", "/description/" . $databox->get_sbas_id() . "/", array(
|
$this->client->request("POST", "/description/" . $databox->get_sbas_id() . "/", array(
|
||||||
@@ -231,7 +231,7 @@ class DescriptionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testPostDescriptionRights()
|
public function testPostDescriptionRights()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$auth = new Session_Authentication_None(self::$user_alt1);
|
$auth = new Session_Authentication_None(self::$user_alt1);
|
||||||
@@ -262,7 +262,7 @@ class DescriptionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGetDescriptionException()
|
public function testGetDescriptionException()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$auth = new Session_Authentication_None(self::$user_alt1);
|
$auth = new Session_Authentication_None(self::$user_alt1);
|
||||||
@@ -277,7 +277,7 @@ class DescriptionTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGetDescription()
|
public function testGetDescription()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$databox = array_shift($appbox->get_databoxes());
|
$databox = array_shift($appbox->get_databoxes());
|
||||||
|
|
||||||
$this->client->request("GET", "/description/" . $databox->get_sbas_id() . "/");
|
$this->client->request("GET", "/description/" . $databox->get_sbas_id() . "/");
|
||||||
|
@@ -44,7 +44,7 @@ class ControllerFieldsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
*/
|
*/
|
||||||
public function testCheckMulti()
|
public function testCheckMulti()
|
||||||
{
|
{
|
||||||
$appbox = \appbox::get_instance();
|
$appbox = \appbox::get_instance(\bootstrap::getCore());
|
||||||
$databox = array_shift($appbox->get_databoxes());
|
$databox = array_shift($appbox->get_databoxes());
|
||||||
|
|
||||||
$field = \databox_field::create($databox, "test" . time());
|
$field = \databox_field::create($databox, "test" . time());
|
||||||
@@ -64,7 +64,7 @@ class ControllerFieldsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testCheckReadOnly()
|
public function testCheckReadOnly()
|
||||||
{
|
{
|
||||||
$appbox = \appbox::get_instance();
|
$appbox = \appbox::get_instance(\bootstrap::getCore());
|
||||||
$databox = array_shift($appbox->get_databoxes());
|
$databox = array_shift($appbox->get_databoxes());
|
||||||
|
|
||||||
$field = \databox_field::create($databox, "test" . time());
|
$field = \databox_field::create($databox, "test" . time());
|
||||||
|
@@ -38,7 +38,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica
|
|||||||
$crawler = $this->client->request('GET', '/publications/list/');
|
$crawler = $this->client->request('GET', '/publications/list/');
|
||||||
$pageContent = $this->client->getResponse()->getContent();
|
$pageContent = $this->client->getResponse()->getContent();
|
||||||
$this->assertTrue($this->client->getResponse()->isOk());
|
$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)
|
foreach ($feeds->get_feeds() as $feed)
|
||||||
{
|
{
|
||||||
@@ -52,7 +52,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica
|
|||||||
|
|
||||||
public function testCreate()
|
public function testCreate()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
foreach ($appbox->get_databoxes() as $databox)
|
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/'));
|
$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());
|
$count_after = sizeof($feeds->get_feeds());
|
||||||
$this->assertGreaterThan($count, $count_after);
|
$this->assertGreaterThan($count, $count_after);
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica
|
|||||||
|
|
||||||
public function testGetFeed()
|
public function testGetFeed()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
||||||
$crawler = $this->client->request('GET', '/publications/feed/' . $feed->get_id() . '/');
|
$crawler = $this->client->request('GET', '/publications/feed/' . $feed->get_id() . '/');
|
||||||
$this->assertTrue($this->client->getResponse()->isOk());
|
$this->assertTrue($this->client->getResponse()->isOk());
|
||||||
@@ -93,7 +93,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica
|
|||||||
|
|
||||||
public function testUpdateFeedNotOwner()
|
public function testUpdateFeedNotOwner()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
//is not owner
|
//is not owner
|
||||||
$stub = $this->getMock("user_adapter", array(), array(), "", false);
|
$stub = $this->getMock("user_adapter", array(), array(), "", false);
|
||||||
//return a different userid
|
//return a different userid
|
||||||
@@ -112,7 +112,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica
|
|||||||
|
|
||||||
public function testUpdatedFeedException()
|
public function testUpdatedFeedException()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica
|
|||||||
|
|
||||||
public function testUpdatedFeedOwner()
|
public function testUpdatedFeedOwner()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
||||||
|
|
||||||
@@ -178,7 +178,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica
|
|||||||
|
|
||||||
public function testIconUploadErrorOwner()
|
public function testIconUploadErrorOwner()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
//is not owner
|
//is not owner
|
||||||
$stub = $this->getMock("user_adapter", array(), array(), "", false);
|
$stub = $this->getMock("user_adapter", array(), array(), "", false);
|
||||||
@@ -199,7 +199,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica
|
|||||||
|
|
||||||
public function testIconUploadErrorFileData()
|
public function testIconUploadErrorFileData()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
||||||
|
|
||||||
@@ -218,7 +218,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica
|
|||||||
|
|
||||||
public function testIconUploadErrorFileType()
|
public function testIconUploadErrorFileType()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
||||||
|
|
||||||
@@ -237,7 +237,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica
|
|||||||
|
|
||||||
public function testIconUploadErrorTooLarge()
|
public function testIconUploadErrorTooLarge()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
||||||
|
|
||||||
@@ -256,7 +256,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica
|
|||||||
|
|
||||||
public function testIconUploadErrorNotSquareA()
|
public function testIconUploadErrorNotSquareA()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
||||||
|
|
||||||
@@ -275,7 +275,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica
|
|||||||
|
|
||||||
public function testIconUploadErrorNotSquareB()
|
public function testIconUploadErrorNotSquareB()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
||||||
|
|
||||||
@@ -294,7 +294,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica
|
|||||||
|
|
||||||
public function testIconUpload()
|
public function testIconUpload()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
||||||
|
|
||||||
@@ -326,7 +326,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica
|
|||||||
|
|
||||||
public function testAddPublisher()
|
public function testAddPublisher()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
||||||
|
|
||||||
@@ -352,7 +352,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica
|
|||||||
|
|
||||||
public function testAddPublisherException()
|
public function testAddPublisherException()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
||||||
|
|
||||||
@@ -372,7 +372,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica
|
|||||||
|
|
||||||
public function testRemovePublisher()
|
public function testRemovePublisher()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
||||||
|
|
||||||
@@ -398,7 +398,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica
|
|||||||
|
|
||||||
public function testRemovePublisherException()
|
public function testRemovePublisherException()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
||||||
|
|
||||||
@@ -420,7 +420,7 @@ class Module_Admin_Route_PublicationTest extends PhraseanetWebTestCaseAuthentica
|
|||||||
|
|
||||||
public function testDeleteFeed()
|
public function testDeleteFeed()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
$feed = Feed_Adapter::create($appbox, self::$user, "salut", 'coucou');
|
||||||
|
|
||||||
|
@@ -44,7 +44,7 @@ class ControllerSubdefsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
*/
|
*/
|
||||||
public function testRouteGetSubdef()
|
public function testRouteGetSubdef()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$databox = array_shift($appbox->get_databoxes());
|
$databox = array_shift($appbox->get_databoxes());
|
||||||
$this->client->request("GET", "/subdefs/" . $databox->get_sbas_id() . "/");
|
$this->client->request("GET", "/subdefs/" . $databox->get_sbas_id() . "/");
|
||||||
$this->assertTrue($this->client->getResponse()->isOk());
|
$this->assertTrue($this->client->getResponse()->isOk());
|
||||||
@@ -52,7 +52,7 @@ class ControllerSubdefsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testPostRouteAddSubdef()
|
public function testPostRouteAddSubdef()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$databox = array_shift($appbox->get_databoxes());
|
$databox = array_shift($appbox->get_databoxes());
|
||||||
$this->client->request("POST", "/subdefs/" . $databox->get_sbas_id() . "/", array('add_subdef' => array(
|
$this->client->request("POST", "/subdefs/" . $databox->get_sbas_id() . "/", array('add_subdef' => array(
|
||||||
'class' => 'thumbnail',
|
'class' => 'thumbnail',
|
||||||
@@ -67,7 +67,7 @@ class ControllerSubdefsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testPostRouteDeleteSubdef()
|
public function testPostRouteDeleteSubdef()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$databox = array_shift($appbox->get_databoxes());
|
$databox = array_shift($appbox->get_databoxes());
|
||||||
$subdefs = $databox->get_subdef_structure();
|
$subdefs = $databox->get_subdef_structure();
|
||||||
$subdefs->add_subdef("image", "name", "class");
|
$subdefs->add_subdef("image", "name", "class");
|
||||||
@@ -86,7 +86,7 @@ class ControllerSubdefsTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testPostRouteAddSubdefWithNoParams()
|
public function testPostRouteAddSubdefWithNoParams()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$databox = array_shift($appbox->get_databoxes());
|
$databox = array_shift($appbox->get_databoxes());
|
||||||
$subdefs = $databox->get_subdef_structure();
|
$subdefs = $databox->get_subdef_structure();
|
||||||
$subdefs->add_subdef("image", "name", "class");
|
$subdefs->add_subdef("image", "name", "class");
|
||||||
|
@@ -57,7 +57,7 @@ class ControllerUsersTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testRouteDelete()
|
public function testRouteDelete()
|
||||||
{
|
{
|
||||||
$appbox = \appbox::get_instance();
|
$appbox = \appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$username = uniqid('user_');
|
$username = uniqid('user_');
|
||||||
$user = User_Adapter::create($appbox, $username, "test", $username . "@email.com", false);
|
$user = User_Adapter::create($appbox, $username, "test", $username . "@email.com", false);
|
||||||
@@ -80,7 +80,7 @@ class ControllerUsersTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testRouteRightsApply()
|
public function testRouteRightsApply()
|
||||||
{
|
{
|
||||||
$appbox = \appbox::get_instance();
|
$appbox = \appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$username = uniqid('user_');
|
$username = uniqid('user_');
|
||||||
$user = User_Adapter::create($appbox, $username, "test", $username . "@email.com", false);
|
$user = User_Adapter::create($appbox, $username, "test", $username . "@email.com", false);
|
||||||
@@ -107,7 +107,7 @@ class ControllerUsersTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
{
|
{
|
||||||
$this->markTestIncomplete();
|
$this->markTestIncomplete();
|
||||||
$_GET = array();
|
$_GET = array();
|
||||||
$appbox = \appbox::get_instance();
|
$appbox = \appbox::get_instance(\bootstrap::getCore());
|
||||||
$username = uniqid('user_');
|
$username = uniqid('user_');
|
||||||
$user = User_Adapter::create($appbox, $username, "test", $username . "@email.com", false);
|
$user = User_Adapter::create($appbox, $username, "test", $username . "@email.com", false);
|
||||||
$base_id = self::$collection->get_base_id();
|
$base_id = self::$collection->get_base_id();
|
||||||
@@ -158,7 +158,7 @@ class ControllerUsersTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testRouteRightTimeApply()
|
public function testRouteRightTimeApply()
|
||||||
{
|
{
|
||||||
$appbox = \appbox::get_instance();
|
$appbox = \appbox::get_instance(\bootstrap::getCore());
|
||||||
$username = uniqid('user_');
|
$username = uniqid('user_');
|
||||||
$user = User_Adapter::create($appbox, $username, "test", $username . "@email.com", false);
|
$user = User_Adapter::create($appbox, $username, "test", $username . "@email.com", false);
|
||||||
$base_id = self::$collection->get_base_id();
|
$base_id = self::$collection->get_base_id();
|
||||||
@@ -221,7 +221,7 @@ class ControllerUsersTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testRouteApplyTp()
|
public function testRouteApplyTp()
|
||||||
{
|
{
|
||||||
$appbox = \appbox::get_instance();
|
$appbox = \appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$templateName = uniqid('template_');
|
$templateName = uniqid('template_');
|
||||||
$template = User_Adapter::create($appbox, $templateName, "test", $templateName . "@email.com", false);
|
$template = User_Adapter::create($appbox, $templateName, "test", $templateName . "@email.com", false);
|
||||||
@@ -266,7 +266,7 @@ class ControllerUsersTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testRouteCreateUser()
|
public function testRouteCreateUser()
|
||||||
{
|
{
|
||||||
$appbox = \appbox::get_instance();
|
$appbox = \appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$username = uniqid('user_');
|
$username = uniqid('user_');
|
||||||
$user = User_Adapter::create($appbox, $username, "test", $username . "@email.com", false);
|
$user = User_Adapter::create($appbox, $username, "test", $username . "@email.com", false);
|
||||||
|
@@ -518,6 +518,10 @@ class ControllerBasketTest extends PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
$this->assertEquals(200, $response->getStatusCode());
|
$this->assertEquals(200, $response->getStatusCode());
|
||||||
|
|
||||||
|
$datas = json_decode($response->getContent());
|
||||||
|
|
||||||
|
$this->assertTrue($datas->success);
|
||||||
|
|
||||||
$em = self::$core->getEntityManager();
|
$em = self::$core->getEntityManager();
|
||||||
/* @var $em \Doctrine\ORM\EntityManager */
|
/* @var $em \Doctrine\ORM\EntityManager */
|
||||||
|
|
||||||
|
@@ -30,20 +30,20 @@ class BridgeApplication extends PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
$this->client = $this->createClient();
|
$this->client = $this->createClient();
|
||||||
try
|
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)
|
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
|
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)
|
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()
|
public function testManager()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$accounts = Bridge_Account::get_accounts_by_user($appbox, self::$user);
|
$accounts = Bridge_Account::get_accounts_by_user($appbox, self::$user);
|
||||||
$usr_id = self::$user->get_id();
|
$usr_id = self::$user->get_id();
|
||||||
|
|
||||||
@@ -87,7 +87,7 @@ class BridgeApplication extends PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testCallBackFailed()
|
public function testCallBackFailed()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$session = $appbox->get_session();
|
$session = $appbox->get_session();
|
||||||
$crawler = $this->client->request('GET', '/bridge/callback/unknow_api/');
|
$crawler = $this->client->request('GET', '/bridge/callback/unknow_api/');
|
||||||
$this->assertTrue($this->client->getResponse()->isOk());
|
$this->assertTrue($this->client->getResponse()->isOk());
|
||||||
@@ -95,7 +95,7 @@ class BridgeApplication extends PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testCallBackAccountAlreadyDefined()
|
public function testCallBackAccountAlreadyDefined()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$crawler = $this->client->request('GET', '/bridge/callback/apitest/');
|
$crawler = $this->client->request('GET', '/bridge/callback/apitest/');
|
||||||
$this->assertTrue($this->client->getResponse()->isOk());
|
$this->assertTrue($this->client->getResponse()->isOk());
|
||||||
$pageContent = $this->client->getResponse()->getContent();
|
$pageContent = $this->client->getResponse()->getContent();
|
||||||
@@ -145,7 +145,7 @@ class BridgeApplication extends PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
});
|
});
|
||||||
try
|
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();
|
$settings = self::$account->get_settings();
|
||||||
$this->assertEquals("kikoo", $settings->get("auth_token"));
|
$this->assertEquals("kikoo", $settings->get("auth_token"));
|
||||||
$this->assertEquals("kooki", $settings->get("refresh_token"));
|
$this->assertEquals("kooki", $settings->get("refresh_token"));
|
||||||
@@ -160,7 +160,7 @@ class BridgeApplication extends PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!self::$account instanceof Bridge_Account)
|
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()
|
public function testLogoutDeconnected()
|
||||||
@@ -186,7 +186,7 @@ class BridgeApplication extends PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
{
|
{
|
||||||
self::$account->get_settings()->set("auth_token", "somethingNotNull"); //connected
|
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());
|
$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));
|
$crawler = $this->client->request('GET', $url, array("page" => 1));
|
||||||
$this->assertTrue($this->client->getResponse()->isOk());
|
$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());
|
$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
|
self::$account->get_settings()->set("auth_token", "somethingNotNull"); //connected
|
||||||
$url = sprintf("/bridge/adapter/%s/load-records/", self::$account->get_id());
|
$url = sprintf("/bridge/adapter/%s/load-records/", self::$account->get_id());
|
||||||
$crawler = $this->client->request('GET', $url, array("page" => 1));
|
$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->assertTrue($this->client->getResponse()->isOk());
|
||||||
$this->assertEquals(sizeof($elements), $crawler->filterXPath("//table/tr")->count());
|
$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());
|
$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
|
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());
|
$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));
|
$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->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());
|
$this->assertNotContains(self::$account->get_api()->generate_login_url(registry::get_instance(), self::$account->get_api()->get_connector()->get_name()), $this->client->getResponse()->getContent());
|
||||||
}
|
}
|
||||||
|
@@ -57,7 +57,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$this->client = $this->createClient();
|
$this->client = $this->createClient();
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testRequestAvailable()
|
public function testRequestAvailable()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$crawler = $this->client->request('POST', '/feeds/requestavailable/');
|
$crawler = $this->client->request('POST', '/feeds/requestavailable/');
|
||||||
$this->assertTrue($this->client->getResponse()->isOk());
|
$this->assertTrue($this->client->getResponse()->isOk());
|
||||||
$feeds = Feed_Collection::load_all($appbox, self::$user);
|
$feeds = Feed_Collection::load_all($appbox, self::$user);
|
||||||
@@ -161,7 +161,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testEntryEdit()
|
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/');
|
$crawler = $this->client->request('GET', '/feeds/entry/' . $this->entry->get_id() . '/edit/');
|
||||||
$pageContent = $this->client->getResponse()->getContent();
|
$pageContent = $this->client->getResponse()->getContent();
|
||||||
@@ -180,7 +180,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testEntryEditUnauthorized()
|
public function testEntryEditUnauthorized()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$feed = Feed_Adapter::create(
|
$feed = Feed_Adapter::create(
|
||||||
$appbox, self::$user_alt1, $this->feed_title, $this->feed_subtitle
|
$appbox, self::$user_alt1, $this->feed_title, $this->feed_subtitle
|
||||||
@@ -212,7 +212,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testEntryUpdate()
|
public function testEntryUpdate()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$params = array(
|
$params = array(
|
||||||
"feed_id" => $this->feed->get_id()
|
"feed_id" => $this->feed->get_id()
|
||||||
@@ -236,7 +236,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testEntryUpdateNotFound()
|
public function testEntryUpdateNotFound()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$params = array(
|
$params = array(
|
||||||
"feed_id" => 9999999
|
"feed_id" => 9999999
|
||||||
@@ -262,7 +262,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testEntryUpdateFailed()
|
public function testEntryUpdateFailed()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$params = array(
|
$params = array(
|
||||||
"feed_id" => 9999999
|
"feed_id" => 9999999
|
||||||
@@ -288,7 +288,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testEntryUpdateUnauthorized()
|
public function testEntryUpdateUnauthorized()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
/**
|
/**
|
||||||
* I CREATE A FEED THAT IS NOT MINE
|
* I CREATE A FEED THAT IS NOT MINE
|
||||||
* */
|
* */
|
||||||
@@ -323,7 +323,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testDelete()
|
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/');
|
$crawler = $this->client->request('POST', '/feeds/entry/' . $this->entry->get_id() . '/delete/');
|
||||||
|
|
||||||
@@ -349,7 +349,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testDeleteNotFound()
|
public function testDeleteNotFound()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$crawler = $this->client->request('POST', '/feeds/entry/9999999/delete/');
|
$crawler = $this->client->request('POST', '/feeds/entry/9999999/delete/');
|
||||||
|
|
||||||
@@ -366,7 +366,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testDeleteUnauthorized()
|
public function testDeleteUnauthorized()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
/**
|
/**
|
||||||
* I CREATE A FEED
|
* I CREATE A FEED
|
||||||
* */
|
* */
|
||||||
@@ -393,7 +393,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testRoot()
|
public function testRoot()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$crawler = $this->client->request('GET', '/feeds/');
|
$crawler = $this->client->request('GET', '/feeds/');
|
||||||
|
|
||||||
@@ -422,7 +422,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testGetFeed()
|
public function testGetFeed()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$feeds = Feed_Collection::load_all($appbox, self::$user);
|
$feeds = Feed_Collection::load_all($appbox, self::$user);
|
||||||
|
|
||||||
@@ -448,7 +448,7 @@ class ControllerFeedApp extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testSuscribeAggregate()
|
public function testSuscribeAggregate()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$feeds = Feed_Collection::load_all($appbox, self::$user);
|
$feeds = Feed_Collection::load_all($appbox, self::$user);
|
||||||
$crawler = $this->client->request('GET', '/feeds/subscribe/aggregated/');
|
$crawler = $this->client->request('GET', '/feeds/subscribe/aggregated/');
|
||||||
$this->assertTrue($this->client->getResponse()->isOk());
|
$this->assertTrue($this->client->getResponse()->isOk());
|
||||||
|
@@ -28,7 +28,7 @@ class ControllerTooltipTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
|
|
||||||
public function testRouteBasket()
|
public function testRouteBasket()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
|
|
||||||
$basket = $this->insertOneBasket();
|
$basket = $this->insertOneBasket();
|
||||||
|
|
||||||
|
@@ -80,11 +80,11 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
|
|||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
$this->client = $this->createClient();
|
$this->client = $this->createClient();
|
||||||
self::$feed = Feed_Adapter::create(appbox::get_instance(), self::$user, 'title', 'subtitle');
|
self::$feed = Feed_Adapter::create(appbox::get_instance(\bootstrap::getCore()), self::$user, 'title', 'subtitle');
|
||||||
self::$publisher = Feed_Publisher_Adapter::getPublisher(appbox::get_instance(), self::$feed, self::$user);
|
self::$publisher = Feed_Publisher_Adapter::getPublisher(appbox::get_instance(\bootstrap::getCore()), self::$feed, self::$user);
|
||||||
self::$entry = Feed_Entry_Adapter::create(appbox::get_instance(), self::$feed, self::$publisher, 'title_entry', 'subtitle', 'hello', "test@mail.com");
|
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(), self::$entry, self::$record_1);
|
Feed_Entry_Item::create(appbox::get_instance(\bootstrap::getCore()), self::$entry, self::$record_1);
|
||||||
Feed_Entry_Item::create(appbox::get_instance(), self::$entry, self::$record_2);
|
Feed_Entry_Item::create(appbox::get_instance(\bootstrap::getCore()), self::$entry, self::$record_2);
|
||||||
self::$feed->set_public(true);
|
self::$feed->set_public(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
|
|||||||
{
|
{
|
||||||
parent::setUpBeforeClass();
|
parent::setUpBeforeClass();
|
||||||
|
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$auth = new Session_Authentication_None(self::$user);
|
$auth = new Session_Authentication_None(self::$user);
|
||||||
$appbox->get_session()->authenticate($auth);
|
$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)
|
//$app->get('/feeds/feed/{id}/{format}/', function($id, $format) use ($app, $appbox, $display_feed)
|
||||||
public function testPublicFeed()
|
public function testPublicFeed()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$auth = new Session_Authentication_None(self::$user);
|
$auth = new Session_Authentication_None(self::$user);
|
||||||
$appbox->get_session()->authenticate($auth);
|
$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)
|
//$app->get('/feeds/userfeed/aggregated/{token}/{format}/', function($token, $format) use ($app, $appbox, $display_feed)
|
||||||
public function testUserFeedAggregated()
|
public function testUserFeedAggregated()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$auth = new Session_Authentication_None(self::$user);
|
$auth = new Session_Authentication_None(self::$user);
|
||||||
$appbox->get_session()->authenticate($auth);
|
$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)
|
//$app->get('/feeds/userfeed/{token}/{id}/{format}/', function($token, $id, $format) use ($app, $appbox, $display_feed)
|
||||||
public function testUserFeed()
|
public function testUserFeed()
|
||||||
{
|
{
|
||||||
$appbox = appbox::get_instance();
|
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||||
$auth = new Session_Authentication_None(self::$user);
|
$auth = new Session_Authentication_None(self::$user);
|
||||||
$appbox->get_session()->authenticate($auth);
|
$appbox->get_session()->authenticate($auth);
|
||||||
|
|
||||||
@@ -306,7 +306,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
|
|||||||
|
|
||||||
public function testGetFeedFormat()
|
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());
|
$feed = array_shift($feeds->get_feeds());
|
||||||
|
|
||||||
$crawler = $this->client->request("GET", "/feeds/feed/" . $feed->get_id() . "/rss/");
|
$crawler = $this->client->request("GET", "/feeds/feed/" . $feed->get_id() . "/rss/");
|
||||||
@@ -334,7 +334,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
|
|||||||
|
|
||||||
public function testAggregatedRss()
|
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();
|
$all_feeds = $feeds->get_feeds();
|
||||||
foreach ($all_feeds as $feed)
|
foreach ($all_feeds as $feed)
|
||||||
{
|
{
|
||||||
@@ -349,7 +349,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
|
|||||||
|
|
||||||
public function testAggregatedAtom()
|
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();
|
$all_feeds = $feeds->get_feeds();
|
||||||
foreach ($all_feeds as $feed)
|
foreach ($all_feeds as $feed)
|
||||||
{
|
{
|
||||||
@@ -374,7 +374,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
|
|||||||
|
|
||||||
public function testGetFeedId()
|
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();
|
$all_feeds = $feeds->get_feeds();
|
||||||
$feed = array_shift($all_feeds);
|
$feed = array_shift($all_feeds);
|
||||||
|
|
||||||
@@ -392,7 +392,7 @@ class ControllerRssFeedTest extends \PhraseanetWebTestCaseAbstract
|
|||||||
|
|
||||||
public function testPrivateFeedAccess()
|
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);
|
$private_feed->set_public(false);
|
||||||
$this->client->request("GET", "/feeds/feed/" . $private_feed->get_id() . "/rss/");
|
$this->client->request("GET", "/feeds/feed/" . $private_feed->get_id() . "/rss/");
|
||||||
$this->assertFalse($this->client->getResponse()->isOk());
|
$this->assertFalse($this->client->getResponse()->isOk());
|
||||||
|
Reference in New Issue
Block a user