]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tests/plugins/PluginWallabagTest.php
New init function for plugins, supports errors reporting
[github/shaarli/Shaarli.git] / tests / plugins / PluginWallabagTest.php
index 302ee296f023d4f8a97db2270cb08e79d6650e82..2c268cbd1b714b3b9aa1c29891bbf40e8592b24a 100644 (file)
@@ -4,8 +4,6 @@
  * PluginWallabagTest.php.php
  */
 
-// FIXME! add an init method.
-$conf = new ConfigManager('');
 require_once 'plugins/wallabag/wallabag.php';
 
 /**
@@ -22,6 +20,27 @@ class PluginWallabagTest extends PHPUnit_Framework_TestCase
         PluginManager::$PLUGINS_PATH = 'plugins';
     }
 
+    /**
+     * Test wallabag init without errors.
+     */
+    function testWallabagInitNoError()
+    {
+        $conf = new ConfigManager('');
+        $conf->set('plugins.WALLABAG_URL', 'value');
+        $errors = wallabag_init($conf);
+        $this->assertEmpty($errors);
+    }
+
+    /**
+     * Test wallabag init with errors.
+     */
+    function testWallabagInitError()
+    {
+        $conf = new ConfigManager('');
+        $errors = wallabag_init($conf);
+        $this->assertNotEmpty($errors);
+    }
+
     /**
      * Test render_linklist hook.
      */