<?php
+use Shaarli\Config\ConfigManager;
/**
* PluginReadityourselfTest.php.php
*/
-// FIXME! add an init method.
-$conf = new ConfigManager('');
require_once 'plugins/readityourself/readityourself.php';
/**
/**
* Reset plugin path
*/
- function setUp()
+ public function setUp()
{
PluginManager::$PLUGINS_PATH = 'plugins';
}
+ /**
+ * Test Readityourself init without errors.
+ */
+ public function testReadityourselfInitNoError()
+ {
+ $conf = new ConfigManager('');
+ $conf->set('plugins.READITYOUSELF_URL', 'value');
+ $errors = readityourself_init($conf);
+ $this->assertEmpty($errors);
+ }
+
+ /**
+ * Test Readityourself init with errors.
+ */
+ public function testReadityourselfInitError()
+ {
+ $conf = new ConfigManager('');
+ $errors = readityourself_init($conf);
+ $this->assertNotEmpty($errors);
+ }
+
/**
* Test render_linklist hook.
*/
- function testReadityourselfLinklist()
+ public function testReadityourselfLinklist()
{
$conf = new ConfigManager('');
$conf->set('plugins.READITYOUSELF_URL', 'value');
/**
* Test without config: nothing should happened.
*/
- function testReadityourselfLinklistWithoutConfig()
+ public function testReadityourselfLinklistWithoutConfig()
{
$conf = new ConfigManager('');
$conf->set('plugins.READITYOUSELF_URL', null);