aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/plugins/PluginReadityourselfTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/plugins/PluginReadityourselfTest.php')
-rw-r--r--tests/plugins/PluginReadityourselfTest.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/plugins/PluginReadityourselfTest.php b/tests/plugins/PluginReadityourselfTest.php
index bc5da042..d73e666a 100644
--- a/tests/plugins/PluginReadityourselfTest.php
+++ b/tests/plugins/PluginReadityourselfTest.php
@@ -4,6 +4,8 @@
4 * PluginReadityourselfTest.php.php 4 * PluginReadityourselfTest.php.php
5 */ 5 */
6 6
7// FIXME! add an init method.
8$conf = new ConfigManager('');
7require_once 'plugins/readityourself/readityourself.php'; 9require_once 'plugins/readityourself/readityourself.php';
8 10
9/** 11/**
@@ -25,7 +27,7 @@ class PluginReadityourselfTest extends PHPUnit_Framework_TestCase
25 */ 27 */
26 function testReadityourselfLinklist() 28 function testReadityourselfLinklist()
27 { 29 {
28 $conf = ConfigManager::getInstance(); 30 $conf = new ConfigManager('');
29 $conf->set('plugins.READITYOUSELF_URL', 'value'); 31 $conf->set('plugins.READITYOUSELF_URL', 'value');
30 $str = 'http://randomstr.com/test'; 32 $str = 'http://randomstr.com/test';
31 $data = array( 33 $data = array(
@@ -37,7 +39,7 @@ class PluginReadityourselfTest extends PHPUnit_Framework_TestCase
37 ) 39 )
38 ); 40 );
39 41
40 $data = hook_readityourself_render_linklist($data); 42 $data = hook_readityourself_render_linklist($data, $conf);
41 $link = $data['links'][0]; 43 $link = $data['links'][0];
42 // data shouldn't be altered 44 // data shouldn't be altered
43 $this->assertEquals($str, $data['title']); 45 $this->assertEquals($str, $data['title']);
@@ -53,7 +55,7 @@ class PluginReadityourselfTest extends PHPUnit_Framework_TestCase
53 */ 55 */
54 function testReadityourselfLinklistWithoutConfig() 56 function testReadityourselfLinklistWithoutConfig()
55 { 57 {
56 $conf = ConfigManager::getInstance(); 58 $conf = new ConfigManager('');
57 $conf->set('plugins.READITYOUSELF_URL', null); 59 $conf->set('plugins.READITYOUSELF_URL', null);
58 $str = 'http://randomstr.com/test'; 60 $str = 'http://randomstr.com/test';
59 $data = array( 61 $data = array(
@@ -65,7 +67,7 @@ class PluginReadityourselfTest extends PHPUnit_Framework_TestCase
65 ) 67 )
66 ); 68 );
67 69
68 $data = hook_readityourself_render_linklist($data); 70 $data = hook_readityourself_render_linklist($data, $conf);
69 $link = $data['links'][0]; 71 $link = $data['links'][0];
70 // data shouldn't be altered 72 // data shouldn't be altered
71 $this->assertEquals($str, $data['title']); 73 $this->assertEquals($str, $data['title']);