From 51def0d84955c7a951bd091eb5eeb3fce9deabd4 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Thu, 9 Jun 2016 20:04:32 +0200 Subject: PluginManager no longer uses singleton pattern --- tests/plugins/PluginReadityourselfTest.php | 10 ++++++---- tests/plugins/PluginWallabagTest.php | 7 ++++--- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'tests/plugins') 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 @@ * PluginReadityourselfTest.php.php */ +// FIXME! add an init method. +$conf = new ConfigManager(''); require_once 'plugins/readityourself/readityourself.php'; /** @@ -25,7 +27,7 @@ class PluginReadityourselfTest extends PHPUnit_Framework_TestCase */ function testReadityourselfLinklist() { - $conf = ConfigManager::getInstance(); + $conf = new ConfigManager(''); $conf->set('plugins.READITYOUSELF_URL', 'value'); $str = 'http://randomstr.com/test'; $data = array( @@ -37,7 +39,7 @@ class PluginReadityourselfTest extends PHPUnit_Framework_TestCase ) ); - $data = hook_readityourself_render_linklist($data); + $data = hook_readityourself_render_linklist($data, $conf); $link = $data['links'][0]; // data shouldn't be altered $this->assertEquals($str, $data['title']); @@ -53,7 +55,7 @@ class PluginReadityourselfTest extends PHPUnit_Framework_TestCase */ function testReadityourselfLinklistWithoutConfig() { - $conf = ConfigManager::getInstance(); + $conf = new ConfigManager(''); $conf->set('plugins.READITYOUSELF_URL', null); $str = 'http://randomstr.com/test'; $data = array( @@ -65,7 +67,7 @@ class PluginReadityourselfTest extends PHPUnit_Framework_TestCase ) ); - $data = hook_readityourself_render_linklist($data); + $data = hook_readityourself_render_linklist($data, $conf); $link = $data['links'][0]; // data shouldn't be altered $this->assertEquals($str, $data['title']); diff --git a/tests/plugins/PluginWallabagTest.php b/tests/plugins/PluginWallabagTest.php index e6f8a8b6..302ee296 100644 --- a/tests/plugins/PluginWallabagTest.php +++ b/tests/plugins/PluginWallabagTest.php @@ -4,6 +4,8 @@ * PluginWallabagTest.php.php */ +// FIXME! add an init method. +$conf = new ConfigManager(''); require_once 'plugins/wallabag/wallabag.php'; /** @@ -25,7 +27,7 @@ class PluginWallabagTest extends PHPUnit_Framework_TestCase */ function testWallabagLinklist() { - $conf = ConfigManager::getInstance(); + $conf = new ConfigManager(''); $conf->set('plugins.WALLABAG_URL', 'value'); $str = 'http://randomstr.com/test'; $data = array( @@ -37,7 +39,7 @@ class PluginWallabagTest extends PHPUnit_Framework_TestCase ) ); - $data = hook_wallabag_render_linklist($data); + $data = hook_wallabag_render_linklist($data, $conf); $link = $data['links'][0]; // data shouldn't be altered $this->assertEquals($str, $data['title']); @@ -49,4 +51,3 @@ class PluginWallabagTest extends PHPUnit_Framework_TestCase $this->assertNotFalse(strpos($link['link_plugin'][0], $conf->get('plugins.WALLABAG_URL'))); } } - -- cgit v1.2.3