]> git.immae.eu Git - github/shaarli/Shaarli.git/blobdiff - tests/config/ConfigPhpTest.php
Fix warnings when upgrading from legacy SebSauvage version
[github/shaarli/Shaarli.git] / tests / config / ConfigPhpTest.php
index 58cd8d2a27cbcc5d691b4af9d02ef2eddc7dd18b..be23eea1563a909ecce1a981d1194040d8d9fe3a 100644 (file)
@@ -1,11 +1,10 @@
 <?php
-
-require_once 'application/config/ConfigPhp.php';
+namespace Shaarli\Config;
 
 /**
  * Class ConfigPhpTest
  */
-class ConfigPhpTest extends PHPUnit_Framework_TestCase
+class ConfigPhpTest extends \PHPUnit_Framework_TestCase
 {
     /**
      * @var ConfigPhp
@@ -37,6 +36,20 @@ class ConfigPhpTest extends PHPUnit_Framework_TestCase
         $this->assertEquals(array(), $this->configIO->read('nope'));
     }
 
+    /**
+     * Read an empty existent config file -> array with blank default values.
+     */
+    public function testReadEmpty()
+    {
+        $dataFile = 'tests/utils/config/emptyConfigPhp.php';
+        $conf = $this->configIO->read($dataFile);
+        $this->assertEmpty($conf['login']);
+        $this->assertEmpty($conf['title']);
+        $this->assertEmpty($conf['titleLink']);
+        $this->assertEmpty($conf['config']);
+        $this->assertEmpty($conf['plugins']);
+    }
+
     /**
      * Write a new config file.
      */