Skip to content
Permalink
Browse files

Small cleanups

  • Loading branch information...
flack committed Nov 2, 2019
1 parent 1624ba5 commit 02bf3fd38e75028b9147373bcb1c641d874970bd
@@ -13,13 +13,19 @@
*/
class midcom_helper_imagepopup_handler_linksTest extends openpsa_testcase
{
protected static $node;
public static function setUpBeforeClass()
{
self::$node = self::get_component_node('net.nehmer.static');
}
public function testHandler_open()
{
midcom::get()->auth->request_sudo('midcom.helper.imagepopup');
$node = self::get_component_node('net.nehmer.static');
$url = $this->run_relocate_handler('net.nehmer.static', ['__ais', 'imagepopup', 'open', 'file', $node->guid]);
$this->assertEquals('__ais/imagepopup/links/file/' . $node->guid . '/', $url);
$url = $this->run_relocate_handler(self::$node, ['__ais', 'imagepopup', 'open', 'file', self::$node->guid]);
$this->assertEquals('__ais/imagepopup/links/file/' . self::$node->guid . '/', $url);
midcom::get()->auth->drop_sudo();
}
@@ -28,7 +34,7 @@ public function testHandler_open_noobject()
{
midcom::get()->auth->request_sudo('midcom.helper.imagepopup');
$url = $this->run_relocate_handler('net.nehmer.static', ['__ais', 'imagepopup', 'open', 'dummy']);
$url = $this->run_relocate_handler(self::$node, ['__ais', 'imagepopup', 'open', 'dummy']);
$this->assertEquals('__ais/imagepopup/folder/dummy/', $url);
midcom::get()->auth->drop_sudo();
@@ -38,9 +44,8 @@ public function testHandler_links()
{
midcom::get()->auth->request_sudo('midcom.helper.imagepopup');
$this->create_user(true);
$node = self::get_component_node('net.nehmer.static');
$data = $this->run_handler('net.nehmer.static', ['__ais', 'imagepopup', 'links', 'file', $node->guid]);
$data = $this->run_handler(self::$node, ['__ais', 'imagepopup', 'links', 'file', self::$node->guid]);
$this->assertEquals('list_links', $data['handler_id']);
midcom::get()->auth->drop_sudo();
@@ -51,7 +56,7 @@ public function testHandler_links_noobject()
midcom::get()->auth->request_sudo('midcom.helper.imagepopup');
$this->create_user(true);
$data = $this->run_handler('net.nehmer.static', ['__ais', 'imagepopup', 'links', 'dummy']);
$data = $this->run_handler(self::$node, ['__ais', 'imagepopup', 'links', 'dummy']);
$this->assertEquals('list_links_noobject', $data['handler_id']);
midcom::get()->auth->drop_sudo();
@@ -13,13 +13,19 @@
*/
class midcom_helper_imagepopup_handler_listTest extends openpsa_testcase
{
protected static $node;
public static function setUpBeforeClass()
{
self::$node = self::get_component_node('net.nehmer.static');
}
public function testHandler_list_folder()
{
midcom::get()->auth->request_sudo('midcom.helper.imagepopup');
$this->create_user(true);
$node = self::get_component_node('net.nehmer.static');
$data = $this->run_handler('net.nehmer.static', ['__ais', 'imagepopup', 'folder', 'file', $node->guid]);
$data = $this->run_handler(self::$node, ['__ais', 'imagepopup', 'folder', 'file', self::$node->guid]);
$this->assertEquals('list_folder', $data['handler_id']);
midcom::get()->auth->drop_sudo();
@@ -30,7 +36,7 @@ public function testHandler_list_folder_noobject()
midcom::get()->auth->request_sudo('midcom.helper.imagepopup');
$this->create_user(true);
$data = $this->run_handler('net.nehmer.static', ['__ais', 'imagepopup', 'folder', 'file']);
$data = $this->run_handler(self::$node, ['__ais', 'imagepopup', 'folder', 'file']);
$this->assertEquals('list_folder_noobject', $data['handler_id']);
midcom::get()->auth->drop_sudo();
@@ -40,9 +46,8 @@ public function testHandler_list_unified()
{
midcom::get()->auth->request_sudo('midcom.helper.imagepopup');
$this->create_user(true);
$node = self::get_component_node('net.nehmer.static');
$data = $this->run_handler('net.nehmer.static', ['__ais', 'imagepopup', 'unified', 'file', $node->guid]);
$data = $this->run_handler(self::$node, ['__ais', 'imagepopup', 'unified', 'file', self::$node->guid]);
$this->assertEquals('list_unified', $data['handler_id']);
midcom::get()->auth->drop_sudo();
@@ -53,7 +58,7 @@ public function testHandler_list_unified_noobject()
midcom::get()->auth->request_sudo('midcom.helper.imagepopup');
$this->create_user(true);
$data = $this->run_handler('net.nehmer.static', ['__ais', 'imagepopup', 'unified', 'file']);
$data = $this->run_handler(self::$node, ['__ais', 'imagepopup', 'unified', 'file']);
$this->assertEquals('list_unified_noobject', $data['handler_id']);
midcom::get()->auth->drop_sudo();
@@ -32,7 +32,7 @@ public function testHandler_upload_guid()
$_FILES['file'] = array_shift(self::$_images);
// Do it goes with guid ?
$data = $this->run_handler('net.nehmer.static', ['__ais', 'imagepopup', 'upload', 'image', $node->guid]);
$data = $this->run_handler($node, ['__ais', 'imagepopup', 'upload', 'image', $node->guid]);
$this->assertEquals('upload_image', $data['handler_id']);
// Do new attachment exists ? Has a location and name ?

0 comments on commit 02bf3fd

Please sign in to comment.
You can’t perform that action at this time.