[task/config-class] Fix db config constructor param order

PHPBB3-9988
This commit is contained in:
Igor Wiedler 2011-01-11 19:38:10 +01:00
parent fb2642bbc6
commit 106f6800d4
2 changed files with 8 additions and 8 deletions

View file

@ -36,11 +36,11 @@ class phpbb_config_db extends phpbb_config
/** /**
* Creates a configuration container with a default set of values * Creates a configuration container with a default set of values
* *
* @param phpbb_cache_driver_interface $cache Cache instance
* @param dbal $db Database connection * @param dbal $db Database connection
* @param phpbb_cache_driver_interface $cache Cache instance
* @param string $table Configuration table name * @param string $table Configuration table name
*/ */
public function __construct(phpbb_cache_driver_interface $cache, dbal $db, $table) public function __construct(dbal $db, phpbb_cache_driver_interface $cache, $table)
{ {
$this->db = $db; $this->db = $db;
$this->cache = $cache; $this->cache = $cache;

View file

@ -26,7 +26,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->cache, $this->db, 'phpbb_config'); $this->config = new phpbb_config_db($this->db, $this->cache, 'phpbb_config');
} }
public function test_load_config() public function test_load_config()
@ -40,7 +40,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->cache, $this->db, 'phpbb_config'); $config2 = new phpbb_config_db($this->db, $this->cache, 'phpbb_config');
$this->assertEquals('23', $config2['foo']); $this->assertEquals('23', $config2['foo']);
} }
@ -50,7 +50,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->cache, $this->db, 'phpbb_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'));
} }
@ -59,7 +59,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->cache, $this->db, 'phpbb_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'));
} }
@ -69,7 +69,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->cache, $this->db, 'phpbb_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'));
} }
@ -79,7 +79,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->cache, $this->db, 'phpbb_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'));
} }