From eeea1c3daa87f133c57c96fa17ed26b02c392636 Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Sun, 29 May 2016 14:41:30 +0200 Subject: Use the configuration manager for wallabag and readityourself plugin --- tests/plugins/PluginReadityourselfTest.php | 6 ++++-- tests/plugins/PluginWallabagTest.php | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'tests/plugins') diff --git a/tests/plugins/PluginReadityourselfTest.php b/tests/plugins/PluginReadityourselfTest.php index 8bf17bf1..bc5da042 100644 --- a/tests/plugins/PluginReadityourselfTest.php +++ b/tests/plugins/PluginReadityourselfTest.php @@ -25,7 +25,8 @@ class PluginReadityourselfTest extends PHPUnit_Framework_TestCase */ function testReadityourselfLinklist() { - $GLOBALS['plugins']['READITYOUSELF_URL'] = 'value'; + $conf = ConfigManager::getInstance(); + $conf->set('plugins.READITYOUSELF_URL', 'value'); $str = 'http://randomstr.com/test'; $data = array( 'title' => $str, @@ -52,7 +53,8 @@ class PluginReadityourselfTest extends PHPUnit_Framework_TestCase */ function testReadityourselfLinklistWithoutConfig() { - unset($GLOBALS['plugins']['READITYOUSELF_URL']); + $conf = ConfigManager::getInstance(); + $conf->set('plugins.READITYOUSELF_URL', null); $str = 'http://randomstr.com/test'; $data = array( 'title' => $str, diff --git a/tests/plugins/PluginWallabagTest.php b/tests/plugins/PluginWallabagTest.php index 5d3a60e0..e6f8a8b6 100644 --- a/tests/plugins/PluginWallabagTest.php +++ b/tests/plugins/PluginWallabagTest.php @@ -25,7 +25,8 @@ class PluginWallabagTest extends PHPUnit_Framework_TestCase */ function testWallabagLinklist() { - $GLOBALS['plugins']['WALLABAG_URL'] = 'value'; + $conf = ConfigManager::getInstance(); + $conf->set('plugins.WALLABAG_URL', 'value'); $str = 'http://randomstr.com/test'; $data = array( 'title' => $str, @@ -45,7 +46,7 @@ class PluginWallabagTest extends PHPUnit_Framework_TestCase // plugin data $this->assertEquals(1, count($link['link_plugin'])); $this->assertNotFalse(strpos($link['link_plugin'][0], urlencode($str))); - $this->assertNotFalse(strpos($link['link_plugin'][0], $GLOBALS['plugins']['WALLABAG_URL'])); + $this->assertNotFalse(strpos($link['link_plugin'][0], $conf->get('plugins.WALLABAG_URL'))); } } -- cgit v1.2.3