diff --git a/application/Updater.php b/application/Updater.php index f5ebf31..27cb2f0 100644 --- a/application/Updater.php +++ b/application/Updater.php @@ -1,4 +1,6 @@ conf = new \ConfigManager('tests/utils/config/configJson.json.php'); + $this->conf = new ConfigManager('tests/utils/config/configJson.json.php'); $this->conf->set('api.secret', 'NapoleonWasALizard'); $this->refDB = new \ReferenceLinkDB(); diff --git a/tests/api/controllers/GetLinkIdTest.php b/tests/api/controllers/GetLinkIdTest.php index 1b02050..45b18e6 100644 --- a/tests/api/controllers/GetLinkIdTest.php +++ b/tests/api/controllers/GetLinkIdTest.php @@ -2,6 +2,7 @@ namespace Shaarli\Api\Controllers; +use Shaarli\Config\ConfigManager; use Slim\Container; use Slim\Http\Environment; @@ -25,7 +26,7 @@ class GetLinkIdTest extends \PHPUnit_Framework_TestCase protected static $testDatastore = 'sandbox/datastore.php'; /** - * @var \ConfigManager instance + * @var ConfigManager instance */ protected $conf; @@ -54,7 +55,7 @@ class GetLinkIdTest extends \PHPUnit_Framework_TestCase */ public function setUp() { - $this->conf = new \ConfigManager('tests/utils/config/configJson'); + $this->conf = new ConfigManager('tests/utils/config/configJson'); $this->refDB = new \ReferenceLinkDB(); $this->refDB->write(self::$testDatastore); diff --git a/tests/api/controllers/GetLinksTest.php b/tests/api/controllers/GetLinksTest.php index da54fcf..10330cd 100644 --- a/tests/api/controllers/GetLinksTest.php +++ b/tests/api/controllers/GetLinksTest.php @@ -1,7 +1,7 @@ conf = new \ConfigManager('tests/utils/config/configJson'); + $this->conf = new ConfigManager('tests/utils/config/configJson'); $this->refDB = new \ReferenceLinkDB(); $this->refDB->write(self::$testDatastore); diff --git a/tests/api/controllers/InfoTest.php b/tests/api/controllers/InfoTest.php index 2916eed..4beef3f 100644 --- a/tests/api/controllers/InfoTest.php +++ b/tests/api/controllers/InfoTest.php @@ -1,7 +1,8 @@ conf = new \ConfigManager('tests/utils/config/configJson.json.php'); + $this->conf = new ConfigManager('tests/utils/config/configJson.json.php'); $this->refDB = new \ReferenceLinkDB(); $this->refDB->write(self::$testDatastore); @@ -84,7 +85,7 @@ class InfoTest extends \PHPUnit_Framework_TestCase $this->assertEquals('Shaarli', $data['settings']['title']); $this->assertEquals('?', $data['settings']['header_link']); $this->assertEquals('UTC', $data['settings']['timezone']); - $this->assertEquals(\ConfigManager::$DEFAULT_PLUGINS, $data['settings']['enabled_plugins']); + $this->assertEquals(ConfigManager::$DEFAULT_PLUGINS, $data['settings']['enabled_plugins']); $this->assertEquals(false, $data['settings']['default_private_links']); $title = 'My links'; diff --git a/tests/config/ConfigJsonTest.php b/tests/config/ConfigJsonTest.php index 07f6ab4..3527f83 100644 --- a/tests/config/ConfigJsonTest.php +++ b/tests/config/ConfigJsonTest.php @@ -1,11 +1,10 @@ empty array. * - * @expectedException Exception + * @expectedException \Exception * @expectedExceptionMessage An error occurred while parsing JSON file: error code #4 */ public function testReadInvalidJson() @@ -112,7 +111,7 @@ class ConfigJsonTest extends PHPUnit_Framework_TestCase /** * Write to invalid path. * - * @expectedException IOException + * @expectedException \IOException */ public function testWriteInvalidArray() { @@ -123,7 +122,7 @@ class ConfigJsonTest extends PHPUnit_Framework_TestCase /** * Write to invalid path. * - * @expectedException IOException + * @expectedException \IOException */ public function testWriteInvalidBlank() { diff --git a/tests/config/ConfigManagerTest.php b/tests/config/ConfigManagerTest.php index 436e3d6..b81be5b 100644 --- a/tests/config/ConfigManagerTest.php +++ b/tests/config/ConfigManagerTest.php @@ -1,4 +1,5 @@