aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/config
diff options
context:
space:
mode:
authorVirtualTam <virtualtam+github@flibidi.net>2017-03-04 20:28:38 +0100
committerGitHub <noreply@github.com>2017-03-04 20:28:38 +0100
commit236239be752a7bb24547237b5751ac4fcbc0e549 (patch)
tree6e1c0130ea30bf218b9a131f58f7224b6defde3f /tests/config
parentcc30d749ab17be2bf0b623a16f8fa78ecfd5b57d (diff)
parent3c66e56435359dc678048193e8ee239d06f79b64 (diff)
downloadShaarli-236239be752a7bb24547237b5751ac4fcbc0e549.tar.gz
Shaarli-236239be752a7bb24547237b5751ac4fcbc0e549.tar.zst
Shaarli-236239be752a7bb24547237b5751ac4fcbc0e549.zip
Merge pull request #788 from virtualtam/application/namespace/config
application: introduce the Shaarli\Config namespace
Diffstat (limited to 'tests/config')
-rw-r--r--tests/config/ConfigJsonTest.php11
-rw-r--r--tests/config/ConfigManagerTest.php9
-rw-r--r--tests/config/ConfigPhpTest.php5
-rw-r--r--tests/config/ConfigPluginTest.php6
4 files changed, 16 insertions, 15 deletions
diff --git a/tests/config/ConfigJsonTest.php b/tests/config/ConfigJsonTest.php
index 07f6ab49..3527f83d 100644
--- a/tests/config/ConfigJsonTest.php
+++ b/tests/config/ConfigJsonTest.php
@@ -1,11 +1,10 @@
1<?php 1<?php
2 2namespace Shaarli\Config;
3require_once 'application/config/ConfigJson.php';
4 3
5/** 4/**
6 * Class ConfigJsonTest 5 * Class ConfigJsonTest
7 */ 6 */
8class ConfigJsonTest extends PHPUnit_Framework_TestCase 7class ConfigJsonTest extends \PHPUnit_Framework_TestCase
9{ 8{
10 /** 9 /**
11 * @var ConfigJson 10 * @var ConfigJson
@@ -40,7 +39,7 @@ class ConfigJsonTest extends PHPUnit_Framework_TestCase
40 /** 39 /**
41 * Read a non existent config file -> empty array. 40 * Read a non existent config file -> empty array.
42 * 41 *
43 * @expectedException Exception 42 * @expectedException \Exception
44 * @expectedExceptionMessage An error occurred while parsing JSON file: error code #4 43 * @expectedExceptionMessage An error occurred while parsing JSON file: error code #4
45 */ 44 */
46 public function testReadInvalidJson() 45 public function testReadInvalidJson()
@@ -112,7 +111,7 @@ class ConfigJsonTest extends PHPUnit_Framework_TestCase
112 /** 111 /**
113 * Write to invalid path. 112 * Write to invalid path.
114 * 113 *
115 * @expectedException IOException 114 * @expectedException \IOException
116 */ 115 */
117 public function testWriteInvalidArray() 116 public function testWriteInvalidArray()
118 { 117 {
@@ -123,7 +122,7 @@ class ConfigJsonTest extends PHPUnit_Framework_TestCase
123 /** 122 /**
124 * Write to invalid path. 123 * Write to invalid path.
125 * 124 *
126 * @expectedException IOException 125 * @expectedException \IOException
127 */ 126 */
128 public function testWriteInvalidBlank() 127 public function testWriteInvalidBlank()
129 { 128 {
diff --git a/tests/config/ConfigManagerTest.php b/tests/config/ConfigManagerTest.php
index 436e3d67..b81be5b6 100644
--- a/tests/config/ConfigManagerTest.php
+++ b/tests/config/ConfigManagerTest.php
@@ -1,4 +1,5 @@
1<?php 1<?php
2namespace Shaarli\Config;
2 3
3/** 4/**
4 * Unit tests for Class ConfigManagerTest 5 * Unit tests for Class ConfigManagerTest
@@ -6,7 +7,7 @@
6 * Note: it only test the manager with ConfigJson, 7 * Note: it only test the manager with ConfigJson,
7 * ConfigPhp is only a workaround to handle the transition to JSON type. 8 * ConfigPhp is only a workaround to handle the transition to JSON type.
8 */ 9 */
9class ConfigManagerTest extends PHPUnit_Framework_TestCase 10class ConfigManagerTest extends \PHPUnit_Framework_TestCase
10{ 11{
11 /** 12 /**
12 * @var ConfigManager 13 * @var ConfigManager
@@ -83,7 +84,7 @@ class ConfigManagerTest extends PHPUnit_Framework_TestCase
83 /** 84 /**
84 * Set with an empty key. 85 * Set with an empty key.
85 * 86 *
86 * @expectedException Exception 87 * @expectedException \Exception
87 * @expectedExceptionMessageRegExp #^Invalid setting key parameter. String expected, got.*# 88 * @expectedExceptionMessageRegExp #^Invalid setting key parameter. String expected, got.*#
88 */ 89 */
89 public function testSetEmptyKey() 90 public function testSetEmptyKey()
@@ -94,7 +95,7 @@ class ConfigManagerTest extends PHPUnit_Framework_TestCase
94 /** 95 /**
95 * Set with an array key. 96 * Set with an array key.
96 * 97 *
97 * @expectedException Exception 98 * @expectedException \Exception
98 * @expectedExceptionMessageRegExp #^Invalid setting key parameter. String expected, got.*# 99 * @expectedExceptionMessageRegExp #^Invalid setting key parameter. String expected, got.*#
99 */ 100 */
100 public function testSetArrayKey() 101 public function testSetArrayKey()
@@ -105,7 +106,7 @@ class ConfigManagerTest extends PHPUnit_Framework_TestCase
105 /** 106 /**
106 * Try to write the config without mandatory parameter (e.g. 'login'). 107 * Try to write the config without mandatory parameter (e.g. 'login').
107 * 108 *
108 * @expectedException MissingFieldConfigException 109 * @expectedException Shaarli\Config\MissingFieldConfigException
109 */ 110 */
110 public function testWriteMissingParameter() 111 public function testWriteMissingParameter()
111 { 112 {
diff --git a/tests/config/ConfigPhpTest.php b/tests/config/ConfigPhpTest.php
index 58cd8d2a..abfbb305 100644
--- a/tests/config/ConfigPhpTest.php
+++ b/tests/config/ConfigPhpTest.php
@@ -1,11 +1,10 @@
1<?php 1<?php
2 2namespace Shaarli\Config;
3require_once 'application/config/ConfigPhp.php';
4 3
5/** 4/**
6 * Class ConfigPhpTest 5 * Class ConfigPhpTest
7 */ 6 */
8class ConfigPhpTest extends PHPUnit_Framework_TestCase 7class ConfigPhpTest extends \PHPUnit_Framework_TestCase
9{ 8{
10 /** 9 /**
11 * @var ConfigPhp 10 * @var ConfigPhp
diff --git a/tests/config/ConfigPluginTest.php b/tests/config/ConfigPluginTest.php
index 3b37cd79..22ab927b 100644
--- a/tests/config/ConfigPluginTest.php
+++ b/tests/config/ConfigPluginTest.php
@@ -1,4 +1,6 @@
1<?php 1<?php
2namespace Shaarli\Config;
3
2/** 4/**
3 * Config' tests 5 * Config' tests
4 */ 6 */
@@ -8,7 +10,7 @@ require_once 'application/config/ConfigPlugin.php';
8/** 10/**
9 * Unitary tests for Shaarli config related functions 11 * Unitary tests for Shaarli config related functions
10 */ 12 */
11class ConfigPluginTest extends PHPUnit_Framework_TestCase 13class ConfigPluginTest extends \PHPUnit_Framework_TestCase
12{ 14{
13 /** 15 /**
14 * Test save_plugin_config with valid data. 16 * Test save_plugin_config with valid data.
@@ -39,7 +41,7 @@ class ConfigPluginTest extends PHPUnit_Framework_TestCase
39 /** 41 /**
40 * Test save_plugin_config with invalid data. 42 * Test save_plugin_config with invalid data.
41 * 43 *
42 * @expectedException PluginConfigOrderException 44 * @expectedException Shaarli\Config\PluginConfigOrderException
43 */ 45 */
44 public function testSavePluginConfigInvalid() 46 public function testSavePluginConfigInvalid()
45 { 47 {