mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-15 05:04:09 +02:00
[ticket/11700] Move all recent code to namespaces
PHPBB3-11700
This commit is contained in:
4
tests/cache/apc_driver_test.php
vendored
4
tests/cache/apc_driver_test.php
vendored
@@ -30,7 +30,7 @@ class phpbb_cache_apc_driver_test extends phpbb_cache_common_test_case
|
||||
self::markTestSkipped('APC extension is not loaded');
|
||||
}
|
||||
|
||||
$php_ini = new phpbb_php_ini;
|
||||
$php_ini = new \phpbb\php\ini;
|
||||
|
||||
if (!$php_ini->get_bool('apc.enabled'))
|
||||
{
|
||||
@@ -47,7 +47,7 @@ class phpbb_cache_apc_driver_test extends phpbb_cache_common_test_case
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->driver = new phpbb_cache_driver_apc;
|
||||
$this->driver = new \phpbb\cache\driver\apc;
|
||||
$this->driver->purge();
|
||||
}
|
||||
}
|
||||
|
12
tests/cache/common_test_case.php
vendored
12
tests/cache/common_test_case.php
vendored
@@ -65,11 +65,11 @@ abstract class phpbb_cache_common_test_case extends phpbb_database_test_case
|
||||
public function test_cache_sql()
|
||||
{
|
||||
global $db, $cache, $phpbb_root_path, $phpEx;
|
||||
$config = new phpbb_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);
|
||||
$cache = new \phpbb\cache\service($this->driver, $config, $db, $phpbb_root_path, $phpEx);
|
||||
|
||||
$sql = "SELECT * FROM phpbb_config
|
||||
$sql = "SELECT * FROM \phpbb\config\config
|
||||
WHERE config_name = 'foo'";
|
||||
|
||||
$result = $db->sql_query($sql, 300);
|
||||
@@ -77,16 +77,16 @@ abstract class phpbb_cache_common_test_case extends phpbb_database_test_case
|
||||
$expected = array('config_name' => 'foo', 'config_value' => '23', 'is_dynamic' => 0);
|
||||
$this->assertEquals($expected, $first_result);
|
||||
|
||||
$sql = 'DELETE FROM phpbb_config';
|
||||
$sql = 'DELETE FROM \phpbb\config\config';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$sql = "SELECT * FROM phpbb_config
|
||||
$sql = "SELECT * FROM \phpbb\config\config
|
||||
WHERE config_name = 'foo'";
|
||||
$result = $db->sql_query($sql, 300);
|
||||
|
||||
$this->assertEquals($expected, $db->sql_fetchrow($result));
|
||||
|
||||
$sql = "SELECT * FROM phpbb_config
|
||||
$sql = "SELECT * FROM \phpbb\config\config
|
||||
WHERE config_name = 'foo'";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
|
2
tests/cache/file_driver_test.php
vendored
2
tests/cache/file_driver_test.php
vendored
@@ -36,7 +36,7 @@ class phpbb_cache_file_driver_test extends phpbb_cache_common_test_case
|
||||
}
|
||||
$this->create_cache_dir();
|
||||
|
||||
$this->driver = new phpbb_cache_driver_file($this->cache_dir);
|
||||
$this->driver = new \phpbb\cache\driver\file($this->cache_dir);
|
||||
}
|
||||
|
||||
protected function tearDown()
|
||||
|
12
tests/cache/null_driver_test.php
vendored
12
tests/cache/null_driver_test.php
vendored
@@ -20,7 +20,7 @@ class phpbb_cache_null_driver_test extends phpbb_database_test_case
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->driver = new phpbb_cache_driver_null;
|
||||
$this->driver = new \phpbb\cache\driver\null;
|
||||
}
|
||||
|
||||
public function test_get_put()
|
||||
@@ -48,23 +48,23 @@ class phpbb_cache_null_driver_test extends phpbb_database_test_case
|
||||
public function test_cache_sql()
|
||||
{
|
||||
global $db, $cache, $phpbb_root_path, $phpEx;
|
||||
$config = new phpbb_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);
|
||||
$cache = new \phpbb\cache\service($this->driver, $config, $db, $phpbb_root_path, $phpEx);
|
||||
|
||||
$sql = "SELECT * FROM phpbb_config
|
||||
$sql = "SELECT * FROM \phpbb\config\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';
|
||||
$sql = 'DELETE FROM \phpbb\config\config';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
// As null cache driver does not actually cache,
|
||||
// this should return no results
|
||||
$sql = "SELECT * FROM phpbb_config
|
||||
$sql = "SELECT * FROM \phpbb\config\config
|
||||
WHERE config_name = 'foo'";
|
||||
$result = $db->sql_query($sql, 300);
|
||||
|
||||
|
2
tests/cache/redis_driver_test.php
vendored
2
tests/cache/redis_driver_test.php
vendored
@@ -43,7 +43,7 @@ class phpbb_cache_redis_driver_test extends phpbb_cache_common_test_case
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->driver = new phpbb_cache_driver_redis(self::$config['host'], self::$config['port']);
|
||||
$this->driver = new \phpbb\cache\driver\redis(self::$config['host'], self::$config['port']);
|
||||
$this->driver->purge();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user