Skip to content

Commit

Permalink
[ticket/11700] Fix config namespace mishap in cache tests
Browse files Browse the repository at this point in the history
PHPBB3-11700
  • Loading branch information
naderman committed Sep 15, 2013
1 parent 76dfe15 commit e10c3d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions tests/cache/common_test_case.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,28 +65,28 @@ public function test_destroy()
public function test_cache_sql()
{
global $db, $cache, $phpbb_root_path, $phpEx;
$config = new \phpbb\config\config(array());
$config = new phpbb\config\config(array());
$db = $this->new_dbal();
$cache = new \phpbb\cache\service($this->driver, $config, $db, $phpbb_root_path, $phpEx);

$sql = "SELECT * FROM \phpbb\config\config
$sql = "SELECT * FROM phpbb_config
WHERE config_name = 'foo'";

$result = $db->sql_query($sql, 300);
$first_result = $db->sql_fetchrow($result);
$expected = array('config_name' => 'foo', 'config_value' => '23', 'is_dynamic' => 0);
$this->assertEquals($expected, $first_result);

$sql = 'DELETE FROM \phpbb\config\config';
$sql = 'DELETE FROM phpbb_config';
$result = $db->sql_query($sql);

$sql = "SELECT * FROM \phpbb\config\config
$sql = "SELECT * FROM phpbb_config
WHERE config_name = 'foo'";
$result = $db->sql_query($sql, 300);

$this->assertEquals($expected, $db->sql_fetchrow($result));

$sql = "SELECT * FROM \phpbb\config\config
$sql = "SELECT * FROM phpbb_config
WHERE config_name = 'foo'";
$result = $db->sql_query($sql);

Expand Down
8 changes: 4 additions & 4 deletions tests/cache/null_driver_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,23 @@ public function test_destroy()
public function test_cache_sql()
{
global $db, $cache, $phpbb_root_path, $phpEx;
$config = new \phpbb\config\config(array());
$config = new phpbb\config\config(array());
$db = $this->new_dbal();
$cache = new \phpbb\cache\service($this->driver, $config, $db, $phpbb_root_path, $phpEx);

$sql = "SELECT * FROM \phpbb\config\config
$sql = "SELECT * FROM phpbb_config
WHERE config_name = 'foo'";
$result = $db->sql_query($sql, 300);
$first_result = $db->sql_fetchrow($result);
$expected = array('config_name' => 'foo', 'config_value' => '23', 'is_dynamic' => 0);
$this->assertEquals($expected, $first_result);

$sql = 'DELETE FROM \phpbb\config\config';
$sql = 'DELETE FROM phpbb_config';
$result = $db->sql_query($sql);

// As null cache driver does not actually cache,
// this should return no results
$sql = "SELECT * FROM \phpbb\config\config
$sql = "SELECT * FROM phpbb_config
WHERE config_name = 'foo'";
$result = $db->sql_query($sql, 300);

Expand Down

0 comments on commit e10c3d8

Please sign in to comment.