4 * PluginPlayvideosTest.php
9 require_once 'plugins/playvideos/playvideos.php';
10 require_once 'application/Router.php';
13 * Class PluginPlayvideosTest
14 * Unit test for the PlayVideos plugin
16 class PluginPlayvideosTest
extends PHPUnit_Framework_TestCase
21 public function setUp()
23 PluginManager
::$PLUGINS_PATH = 'plugins';
27 * Test render_linklist hook.
29 public function testPlayvideosHeader()
32 $data = array($str => $str);
33 $data['_PAGE_'] = Router
::$PAGE_LINKLIST;
35 $data = hook_playvideos_render_header($data);
36 $this->assertEquals($str, $data[$str]);
37 $this->assertEquals(1, count($data['buttons_toolbar']));
39 $data = array($str => $str);
40 $data['_PAGE_'] = $str;
41 $this->assertEquals($str, $data[$str]);
42 $this->assertArrayNotHasKey('buttons_toolbar', $data);
46 * Test render_footer hook.
48 public function testPlayvideosFooter()
51 $data = array($str => $str);
52 $data['_PAGE_'] = Router
::$PAGE_LINKLIST;
54 $data = hook_playvideos_render_footer($data);
55 $this->assertEquals($str, $data[$str]);
56 $this->assertEquals(2, count($data['js_files']));
58 $data = array($str => $str);
59 $data['_PAGE_'] = $str;
60 $this->assertEquals($str, $data[$str]);
61 $this->assertArrayNotHasKey('js_files', $data);