4 * PluginPlayvideosTest.php
7 require_once 'plugins/playvideos/playvideos.php';
8 require_once 'application/Router.php';
11 * Class PluginPlayvideosTest
12 * Unit test for the PlayVideos plugin
14 class PluginPlayvideosTest
extends PHPUnit_Framework_TestCase
21 PluginManager
::$PLUGINS_PATH = 'plugins';
25 * Test render_linklist hook.
27 function testPlayvideosHeader()
30 $data = array($str => $str);
31 $data['_PAGE_'] = Router
::$PAGE_LINKLIST;
33 $data = hook_playvideos_render_header($data);
34 $this->assertEquals($str, $data[$str]);
35 $this->assertEquals(1, count($data['buttons_toolbar']));
37 $data = array($str => $str);
38 $data['_PAGE_'] = $str;
39 $this->assertEquals($str, $data[$str]);
40 $this->assertArrayNotHasKey('buttons_toolbar', $data);
44 * Test render_footer hook.
46 function testPlayvideosFooter()
49 $data = array($str => $str);
50 $data['_PAGE_'] = Router
::$PAGE_LINKLIST;
52 $data = hook_playvideos_render_footer($data);
53 $this->assertEquals($str, $data[$str]);
54 $this->assertEquals(2, count($data['js_files']));
56 $data = array($str => $str);
57 $data['_PAGE_'] = $str;
58 $this->assertEquals($str, $data[$str]);
59 $this->assertArrayNotHasKey('js_files', $data);