diff options
author | Nils Adermann <naderman@naderman.de> | 2013-09-10 14:01:09 +0200 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2013-09-16 00:25:27 +0200 |
commit | b95fdacdd378877d277e261465da73deb06e50da (patch) | |
tree | 01d55340b37f412cecd2d898c302e101b8a0ed19 /tests/config | |
parent | 196e1813cd37c47965eb6f254ce6a55210a1b751 (diff) | |
download | forums-b95fdacdd378877d277e261465da73deb06e50da.tar forums-b95fdacdd378877d277e261465da73deb06e50da.tar.gz forums-b95fdacdd378877d277e261465da73deb06e50da.tar.bz2 forums-b95fdacdd378877d277e261465da73deb06e50da.tar.xz forums-b95fdacdd378877d277e261465da73deb06e50da.zip |
[ticket/11700] Move all recent code to namespaces
PHPBB3-11700
Diffstat (limited to 'tests/config')
-rw-r--r-- | tests/config/config_test.php | 28 | ||||
-rw-r--r-- | tests/config/db_test.php | 16 | ||||
-rw-r--r-- | tests/config/db_text_test.php | 2 |
3 files changed, 23 insertions, 23 deletions
diff --git a/tests/config/config_test.php b/tests/config/config_test.php index 5845cc4590..5373fcef5f 100644 --- a/tests/config/config_test.php +++ b/tests/config/config_test.php @@ -11,7 +11,7 @@ class phpbb_config_test extends phpbb_test_case { public function test_offset_exists() { - $config = new phpbb_config(array('foo' => 'bar')); + $config = new \phpbb\config\config(array('foo' => 'bar')); $this->assertTrue(isset($config['foo'])); $this->assertFalse(isset($config['foobar'])); @@ -19,19 +19,19 @@ class phpbb_config_test extends phpbb_test_case public function test_offset_get() { - $config = new phpbb_config(array('foo' => 'bar')); + $config = new \phpbb\config\config(array('foo' => 'bar')); $this->assertEquals('bar', $config['foo']); } public function test_offset_get_missing() { - $config = new phpbb_config(array()); + $config = new \phpbb\config\config(array()); $this->assertEquals('', $config['foo']); } public function test_offset_set() { - $config = new phpbb_config(array()); + $config = new \phpbb\config\config(array()); $config['foo'] = 'x'; $this->assertEquals('x', $config['foo']); } @@ -39,20 +39,20 @@ class phpbb_config_test extends phpbb_test_case public function test_offset_unset_fails() { $this->setExpectedTriggerError(E_USER_ERROR); - $config = new phpbb_config(array('foo' => 'x')); + $config = new \phpbb\config\config(array('foo' => 'x')); unset($config['foo']); } public function test_count() { - $config = new phpbb_config(array('foo' => 'bar')); + $config = new \phpbb\config\config(array('foo' => 'bar')); $this->assertEquals(1, count($config)); } public function test_iterate() { $vars = array('foo' => '23', 'bar' => '42'); - $config = new phpbb_config($vars); + $config = new \phpbb\config\config($vars); $count = 0; foreach ($config as $key => $value) @@ -68,42 +68,42 @@ class phpbb_config_test extends phpbb_test_case public function test_set_overwrite() { - $config = new phpbb_config(array('foo' => 'x')); + $config = new \phpbb\config\config(array('foo' => 'x')); $config->set('foo', 'bar'); $this->assertEquals('bar', $config['foo']); } public function test_set_new() { - $config = new phpbb_config(array()); + $config = new \phpbb\config\config(array()); $config->set('foo', 'bar'); $this->assertEquals('bar', $config['foo']); } public function test_set_atomic_overwrite() { - $config = new phpbb_config(array('foo' => 'bar')); + $config = new \phpbb\config\config(array('foo' => 'bar')); $this->assertTrue($config->set_atomic('foo', 'bar', '23')); $this->assertEquals('23', $config['foo']); } public function test_set_atomic_new() { - $config = new phpbb_config(array()); + $config = new \phpbb\config\config(array()); $this->assertTrue($config->set_atomic('foo', false, '23')); $this->assertEquals('23', $config['foo']); } public function test_set_atomic_failure() { - $config = new phpbb_config(array('foo' => 'bar')); + $config = new \phpbb\config\config(array('foo' => 'bar')); $this->assertFalse($config->set_atomic('foo', 'wrong', '23')); $this->assertEquals('bar', $config['foo']); } public function test_increment() { - $config = new phpbb_config(array('foo' => '23')); + $config = new \phpbb\config\config(array('foo' => '23')); $config->increment('foo', 3); $this->assertEquals(26, $config['foo']); $config->increment('foo', 1); @@ -112,7 +112,7 @@ class phpbb_config_test extends phpbb_test_case public function test_delete() { - $config = new phpbb_config(array('foo' => 'bar')); + $config = new \phpbb\config\config(array('foo' => 'bar')); $config->delete('foo'); $this->assertFalse(isset($config['foo'])); diff --git a/tests/config/db_test.php b/tests/config/db_test.php index 0b8f73d53a..a014c72c65 100644 --- a/tests/config/db_test.php +++ b/tests/config/db_test.php @@ -24,7 +24,7 @@ class phpbb_config_db_test extends phpbb_database_test_case $this->cache = new phpbb_mock_cache; $this->db = $this->new_dbal(); - $this->config = new phpbb_config_db($this->db, $this->cache, 'phpbb_config'); + $this->config = new \phpbb\config\db($this->db, $this->cache, '\phpbb\config\config'); } public function test_load_config() @@ -36,7 +36,7 @@ class phpbb_config_db_test extends phpbb_database_test_case public function test_load_cached() { $cache = new phpbb_mock_cache(array('config' => array('x' => 'y'))); - $this->config = new phpbb_config_db($this->db, $cache, 'phpbb_config'); + $this->config = new \phpbb\config\db($this->db, $cache, '\phpbb\config\config'); $this->assertTrue(!isset($this->config['foo'])); $this->assertEquals('42', $this->config['bar']); @@ -49,7 +49,7 @@ class phpbb_config_db_test extends phpbb_database_test_case $this->config['foo'] = 'x'; // temporary set $this->assertEquals('x', $this->config['foo']); - $config2 = new phpbb_config_db($this->db, $this->cache, 'phpbb_config'); + $config2 = new \phpbb\config\db($this->db, $this->cache, '\phpbb\config\config'); $this->assertEquals('23', $config2['foo']); } @@ -59,7 +59,7 @@ class phpbb_config_db_test extends phpbb_database_test_case $this->assertEquals('17', $this->config['foo']); // re-read config and populate cache - $config2 = new phpbb_config_db($this->db, $this->cache, 'phpbb_config'); + $config2 = new \phpbb\config\db($this->db, $this->cache, '\phpbb\config\config'); $this->cache->checkVar($this, 'config', array('foo' => '17')); } @@ -68,7 +68,7 @@ class phpbb_config_db_test extends phpbb_database_test_case $this->config->set('bar', '17', false); // re-read config and populate cache - $config2 = new phpbb_config_db($this->db, $this->cache, 'phpbb_config'); + $config2 = new \phpbb\config\db($this->db, $this->cache, '\phpbb\config\config'); $this->cache->checkVar($this, 'config', array('foo' => '23')); } @@ -78,7 +78,7 @@ class phpbb_config_db_test extends phpbb_database_test_case $this->assertEquals('5', $this->config['foobar']); // re-read config and populate cache - $config2 = new phpbb_config_db($this->db, $this->cache, 'phpbb_config'); + $config2 = new \phpbb\config\db($this->db, $this->cache, '\phpbb\config\config'); $this->cache->checkVar($this, 'config', array('foo' => '23', 'foobar' => '5')); } @@ -88,7 +88,7 @@ class phpbb_config_db_test extends phpbb_database_test_case $this->assertEquals('5', $this->config['foobar']); // re-read config and populate cache - $config2 = new phpbb_config_db($this->db, $this->cache, 'phpbb_config'); + $config2 = new \phpbb\config\db($this->db, $this->cache, '\phpbb\config\config'); $this->cache->checkVar($this, 'config', array('foo' => '23')); } @@ -133,7 +133,7 @@ class phpbb_config_db_test extends phpbb_database_test_case // re-read config and populate cache $cache2 = new phpbb_mock_cache; - $config2 = new phpbb_config_db($this->db, $cache2, 'phpbb_config'); + $config2 = new \phpbb\config\db($this->db, $cache2, '\phpbb\config\config'); $cache2->checkVarUnset($this, 'foo'); $this->assertFalse(isset($config2['foo'])); } diff --git a/tests/config/db_text_test.php b/tests/config/db_text_test.php index 4818bba8c9..354c0efacf 100644 --- a/tests/config/db_text_test.php +++ b/tests/config/db_text_test.php @@ -22,7 +22,7 @@ class phpbb_config_db_text_test extends phpbb_database_test_case parent::setUp(); $this->db = $this->new_dbal(); - $this->config_text = new phpbb_config_db_text($this->db, 'phpbb_config_text'); + $this->config_text = new \phpbb\config\db_text($this->db, 'phpbb_config_text'); } public function test_get() |