2 namespace Shaarli\Plugin\Playvideos
;
5 * PluginPlayvideosTest.php
8 use Shaarli\Plugin\PluginManager
;
9 use Shaarli\Render\TemplatePage
;
11 require_once 'plugins/playvideos/playvideos.php';
14 * Class PluginPlayvideosTest
15 * Unit test for the PlayVideos plugin
17 class PluginPlayvideosTest
extends \Shaarli\TestCase
22 protected function setUp(): void
24 PluginManager
::$PLUGINS_PATH = 'plugins';
28 * Test render_linklist hook.
30 public function testPlayvideosHeader()
33 $data = array($str => $str);
34 $data['_PAGE_'] = TemplatePage
::LINKLIST
;
36 $data = hook_playvideos_render_header($data);
37 $this->assertEquals($str, $data[$str]);
38 $this->assertEquals(1, count($data['buttons_toolbar']));
40 $data = array($str => $str);
41 $data['_PAGE_'] = $str;
42 $this->assertEquals($str, $data[$str]);
43 $this->assertArrayNotHasKey('buttons_toolbar', $data);
47 * Test render_footer hook.
49 public function testPlayvideosFooter()
52 $data = array($str => $str);
53 $data['_PAGE_'] = TemplatePage
::LINKLIST
;
55 $data = hook_playvideos_render_footer($data);
56 $this->assertEquals($str, $data[$str]);
57 $this->assertEquals(2, count($data['js_files']));
59 $data = array($str => $str);
60 $data['_PAGE_'] = $str;
61 $this->assertEquals($str, $data[$str]);
62 $this->assertArrayNotHasKey('js_files', $data);