]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tests/plugins/PluginReadityourselfTest.php
New init function for plugins, supports errors reporting
[github/shaarli/Shaarli.git] / tests / plugins / PluginReadityourselfTest.php
index d73e666a5157c99987e9b273188e375adace5711..532db14626d5e177566ddd8c352f5fab621f91a2 100644 (file)
@@ -4,8 +4,6 @@
  * PluginReadityourselfTest.php.php
  */
 
-// FIXME! add an init method.
-$conf = new ConfigManager('');
 require_once 'plugins/readityourself/readityourself.php';
 
 /**
@@ -22,6 +20,27 @@ class PluginReadityourselfTest extends PHPUnit_Framework_TestCase
         PluginManager::$PLUGINS_PATH = 'plugins';
     }
 
+    /**
+     * Test Readityourself init without errors.
+     */
+    function testReadityourselfInitNoError()
+    {
+        $conf = new ConfigManager('');
+        $conf->set('plugins.READITYOUSELF_URL', 'value');
+        $errors = readityourself_init($conf);
+        $this->assertEmpty($errors);
+    }
+
+    /**
+     * Test Readityourself init with errors.
+     */
+    function testReadityourselfInitError()
+    {
+        $conf = new ConfigManager('');
+        $errors = readityourself_init($conf);
+        $this->assertNotEmpty($errors);
+    }
+
     /**
      * Test render_linklist hook.
      */