4 * PluginPlayvideosTest.php
7 require_once 'plugins/addlink_toolbar/addlink_toolbar.php';
8 require_once 'application/Router.php';
11 * Class PluginAddlinkTest
12 * Unit test for the Addlink toolbar plugin
14 class PluginAddlinkTest
extends PHPUnit_Framework_TestCase
19 public function setUp()
21 PluginManager
::$PLUGINS_PATH = 'plugins';
25 * Test render_header hook while logged in.
27 public function testAddlinkHeaderLoggedIn()
30 $data = array($str => $str);
31 $data['_PAGE_'] = Router
::$PAGE_LINKLIST;
32 $data['_LOGGEDIN_'] = true;
34 $data = hook_addlink_toolbar_render_header($data);
35 $this->assertEquals($str, $data[$str]);
36 $this->assertEquals(1, count($data['fields_toolbar']));
38 $data = array($str => $str);
39 $data['_PAGE_'] = $str;
40 $data['_LOGGEDIN_'] = true;
41 $data = hook_addlink_toolbar_render_header($data);
42 $this->assertEquals($str, $data[$str]);
43 $this->assertArrayNotHasKey('fields_toolbar', $data);
47 * Test render_header hook while logged out.
49 public function testAddlinkHeaderLoggedOut()
52 $data = array($str => $str);
53 $data['_PAGE_'] = Router
::$PAGE_LINKLIST;
54 $data['_LOGGEDIN_'] = false;
56 $data = hook_addlink_toolbar_render_header($data);
57 $this->assertEquals($str, $data[$str]);
58 $this->assertArrayNotHasKey('fields_toolbar', $data);