Use the configuration manager for wallabag and readityourself plugin
This commit is contained in:
parent
d93d51b213
commit
eeea1c3daa
4 changed files with 22 additions and 23 deletions
tests/plugins
|
@ -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,
|
||||
|
|
|
@ -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')));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue