]> git.immae.eu Git - github/shaarli/Shaarli.git/blame - tests/plugins/PluginPlayvideosTest.php
Merge pull request #1092 from ArthurHoaro/fix/scuttle-doctype-case
[github/shaarli/Shaarli.git] / tests / plugins / PluginPlayvideosTest.php
CommitLineData
840caea6
A
1<?php
2
3/**
4 * PluginPlayvideosTest.php
5 */
6
7require_once 'plugins/playvideos/playvideos.php';
8require_once 'application/Router.php';
9
10/**
11 * Class PluginPlayvideosTest
12 * Unit test for the PlayVideos plugin
13 */
14class PluginPlayvideosTest extends PHPUnit_Framework_TestCase
15{
16 /**
17 * Reset plugin path
18 */
93b1fe54 19 public function setUp()
840caea6
A
20 {
21 PluginManager::$PLUGINS_PATH = 'plugins';
22 }
23
24 /**
25 * Test render_linklist hook.
26 */
93b1fe54 27 public function testPlayvideosHeader()
840caea6
A
28 {
29 $str = 'stuff';
30 $data = array($str => $str);
31 $data['_PAGE_'] = Router::$PAGE_LINKLIST;
32
33 $data = hook_playvideos_render_header($data);
34 $this->assertEquals($str, $data[$str]);
35 $this->assertEquals(1, count($data['buttons_toolbar']));
36
37 $data = array($str => $str);
38 $data['_PAGE_'] = $str;
39 $this->assertEquals($str, $data[$str]);
40 $this->assertArrayNotHasKey('buttons_toolbar', $data);
41 }
42
43 /**
44 * Test render_footer hook.
45 */
93b1fe54 46 public function testPlayvideosFooter()
840caea6
A
47 {
48 $str = 'stuff';
49 $data = array($str => $str);
50 $data['_PAGE_'] = Router::$PAGE_LINKLIST;
51
52 $data = hook_playvideos_render_footer($data);
53 $this->assertEquals($str, $data[$str]);
54 $this->assertEquals(2, count($data['js_files']));
55
56 $data = array($str => $str);
57 $data['_PAGE_'] = $str;
58 $this->assertEquals($str, $data[$str]);
59 $this->assertArrayNotHasKey('js_files', $data);
60 }
61}