mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/11700] Fix config db tests after namespace mishap
PHPBB3-11700
This commit is contained in:
parent
43c5ed570f
commit
1a6202d517
1 changed files with 10 additions and 10 deletions
|
@ -24,7 +24,7 @@ class phpbb_config_db_test extends phpbb_database_test_case
|
||||||
|
|
||||||
$this->cache = new phpbb_mock_cache;
|
$this->cache = new phpbb_mock_cache;
|
||||||
$this->db = $this->new_dbal();
|
$this->db = $this->new_dbal();
|
||||||
$this->config = new \phpbb\config\db($this->db, $this->cache, '\phpbb\config\config');
|
$this->config = new \phpbb\config\db($this->db, $this->cache, 'phpbb_config');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_load_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()
|
public function test_load_cached()
|
||||||
{
|
{
|
||||||
$cache = new phpbb_mock_cache(array('config' => array('x' => 'y')));
|
$cache = new phpbb_mock_cache(array('config' => array('x' => 'y')));
|
||||||
$this->config = new \phpbb\config\db($this->db, $cache, '\phpbb\config\config');
|
$this->config = new \phpbb\config\db($this->db, $cache, 'phpbb_config');
|
||||||
|
|
||||||
$this->assertTrue(!isset($this->config['foo']));
|
$this->assertTrue(!isset($this->config['foo']));
|
||||||
$this->assertEquals('42', $this->config['bar']);
|
$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->config['foo'] = 'x'; // temporary set
|
||||||
$this->assertEquals('x', $this->config['foo']);
|
$this->assertEquals('x', $this->config['foo']);
|
||||||
|
|
||||||
$config2 = new \phpbb\config\db($this->db, $this->cache, '\phpbb\config\config');
|
$config2 = new \phpbb\config\db($this->db, $this->cache, 'phpbb_config');
|
||||||
$this->assertEquals('23', $config2['foo']);
|
$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']);
|
$this->assertEquals('17', $this->config['foo']);
|
||||||
|
|
||||||
// re-read config and populate cache
|
// re-read config and populate cache
|
||||||
$config2 = new \phpbb\config\db($this->db, $this->cache, '\phpbb\config\config');
|
$config2 = new \phpbb\config\db($this->db, $this->cache, 'phpbb_config');
|
||||||
$this->cache->checkVar($this, 'config', array('foo' => '17'));
|
$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);
|
$this->config->set('bar', '17', false);
|
||||||
|
|
||||||
// re-read config and populate cache
|
// re-read config and populate cache
|
||||||
$config2 = new \phpbb\config\db($this->db, $this->cache, '\phpbb\config\config');
|
$config2 = new \phpbb\config\db($this->db, $this->cache, 'phpbb_config');
|
||||||
$this->cache->checkVar($this, 'config', array('foo' => '23'));
|
$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']);
|
$this->assertEquals('5', $this->config['foobar']);
|
||||||
|
|
||||||
// re-read config and populate cache
|
// re-read config and populate cache
|
||||||
$config2 = new \phpbb\config\db($this->db, $this->cache, '\phpbb\config\config');
|
$config2 = new \phpbb\config\db($this->db, $this->cache, 'phpbb_config');
|
||||||
$this->cache->checkVar($this, 'config', array('foo' => '23', 'foobar' => '5'));
|
$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']);
|
$this->assertEquals('5', $this->config['foobar']);
|
||||||
|
|
||||||
// re-read config and populate cache
|
// re-read config and populate cache
|
||||||
$config2 = new \phpbb\config\db($this->db, $this->cache, '\phpbb\config\config');
|
$config2 = new \phpbb\config\db($this->db, $this->cache, 'phpbb_config');
|
||||||
$this->cache->checkVar($this, 'config', array('foo' => '23'));
|
$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
|
// re-read config and populate cache
|
||||||
$cache2 = new phpbb_mock_cache;
|
$cache2 = new phpbb_mock_cache;
|
||||||
$config2 = new \phpbb\config\db($this->db, $cache2, '\phpbb\config\config');
|
$config2 = new \phpbb\config\db($this->db, $cache2, 'phpbb_config');
|
||||||
$cache2->checkVarUnset($this, 'foo');
|
$cache2->checkVarUnset($this, 'foo');
|
||||||
$this->assertFalse(isset($config2['foo']));
|
$this->assertFalse(isset($config2['foo']));
|
||||||
}
|
}
|
||||||
|
@ -145,7 +145,7 @@ class phpbb_config_db_test extends phpbb_database_test_case
|
||||||
$this->config->delete('bar');
|
$this->config->delete('bar');
|
||||||
$this->cache->checkVarUnset($this, 'bar');
|
$this->cache->checkVarUnset($this, 'bar');
|
||||||
$this->assertFalse(isset($this->config['bar']));
|
$this->assertFalse(isset($this->config['bar']));
|
||||||
|
|
||||||
$this->config->set('bar', 'new bar', false);
|
$this->config->set('bar', 'new bar', false);
|
||||||
$this->assertEquals('new bar', $this->config['bar']);
|
$this->assertEquals('new bar', $this->config['bar']);
|
||||||
}
|
}
|
||||||
|
@ -157,7 +157,7 @@ class phpbb_config_db_test extends phpbb_database_test_case
|
||||||
$this->config->delete('foo');
|
$this->config->delete('foo');
|
||||||
$this->cache->checkVarUnset($this, 'foo');
|
$this->cache->checkVarUnset($this, 'foo');
|
||||||
$this->assertFalse(isset($this->config['foo']));
|
$this->assertFalse(isset($this->config['foo']));
|
||||||
|
|
||||||
$this->config->set('foo', 'new foo', true);
|
$this->config->set('foo', 'new foo', true);
|
||||||
$this->assertEquals('new foo', $this->config['foo']);
|
$this->assertEquals('new foo', $this->config['foo']);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue