1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-23 08:43:02 +02:00

[ticket/11700] Move all recent code to namespaces

PHPBB3-11700
This commit is contained in:
Nils Adermann
2013-09-10 14:01:09 +02:00
parent 196e1813cd
commit b95fdacdd3
420 changed files with 2316 additions and 1840 deletions

View File

@@ -7,7 +7,7 @@
*
*/
class phpbb_auth_provider_acp_board_valid extends phpbb_auth_provider_base
class phpbb_auth_provider_acp_board_valid extends \phpbb\auth\provider\base
{
public function login($username, $password)
{

View File

@@ -22,11 +22,11 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case
global $phpbb_root_path, $phpEx;
$db = $this->new_dbal();
$config = new phpbb_config(array());
$this->request = $this->getMock('phpbb_request');
$this->user = $this->getMock('phpbb_user');
$config = new \phpbb\config\config(array());
$this->request = $this->getMock('\phpbb\request\request');
$this->user = $this->getMock('\phpbb\user');
$this->provider = new phpbb_auth_provider_apache($db, $config, $this->request, $this->user, $phpbb_root_path, $phpEx);
$this->provider = new \phpbb\auth\provider\apache($db, $config, $this->request, $this->user, $phpbb_root_path, $phpEx);
}
public function getDataSet()
@@ -43,7 +43,7 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case
$this->request->expects($this->once())
->method('is_set')
->with('PHP_AUTH_USER',
phpbb_request_request_interface::SERVER)
\phpbb\request\request_interface::SERVER)
->will($this->returnValue(true));
$this->request->expects($this->once())
->method('server')
@@ -61,7 +61,7 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case
$this->request->expects($this->once())
->method('is_set')
->with('PHP_AUTH_USER',
phpbb_request_request_interface::SERVER)
\phpbb\request\request_interface::SERVER)
->will($this->returnValue(true));
$this->request->expects($this->at(1))
->method('server')
@@ -93,7 +93,7 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case
$this->request->expects($this->once())
->method('is_set')
->with('PHP_AUTH_USER',
phpbb_request_request_interface::SERVER)
\phpbb\request\request_interface::SERVER)
->will($this->returnValue(true));
$this->request->expects($this->at(1))
->method('server')
@@ -194,7 +194,7 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case
$this->request->expects($this->once())
->method('is_set')
->with('PHP_AUTH_USER',
phpbb_request_request_interface::SERVER)
\phpbb\request\request_interface::SERVER)
->will($this->returnValue(true));
$this->request->expects($this->once())
->method('server')

View File

@@ -21,14 +21,14 @@ class phpbb_auth_provider_db_test extends phpbb_database_test_case
global $phpbb_root_path, $phpEx;
$db = $this->new_dbal();
$config = new phpbb_config(array(
$config = new \phpbb\config\config(array(
'ip_login_limit_max' => 0,
'ip_login_limit_use_forwarded' => 0,
'max_login_attempts' => 0,
));
$request = $this->getMock('phpbb_request');
$user = $this->getMock('phpbb_user');
$provider = new phpbb_auth_provider_db($db, $config, $request, $user, $phpbb_root_path, $phpEx);
$request = $this->getMock('\phpbb\request\request');
$user = $this->getMock('\phpbb\user');
$provider = new \phpbb\auth\provider\db($db, $config, $request, $user, $phpbb_root_path, $phpEx);
$expected = array(
'status' => LOGIN_SUCCESS,

View File

@@ -1,6 +1,6 @@
<?php
class phpbb_avatar_driver_barfoo extends phpbb_avatar_driver
class phpbb_avatar_driver_barfoo extends \phpbb\avatar\driver\driver
{
public function get_data($row)
{

View File

@@ -1,6 +1,6 @@
<?php
class phpbb_avatar_driver_foobar extends phpbb_avatar_driver
class phpbb_avatar_driver_foobar extends \phpbb\avatar\driver\driver
{
public function get_data($row)
{

View File

@@ -22,9 +22,9 @@ class phpbb_avatar_manager_test extends PHPUnit_Framework_TestCase
->will($this->returnArgument(0));
// Prepare dependencies for avatar manager and driver
$config = new phpbb_config(array());
$request = $this->getMock('phpbb_request');
$cache = $this->getMock('phpbb_cache_driver_driver_interface');
$config = new \phpbb\config\config(array());
$request = $this->getMock('\phpbb\request\request');
$cache = $this->getMock('\phpbb\cache\driver\driver_interface');
// $this->avatar_foobar will be needed later on
$this->avatar_foobar = $this->getMock('phpbb_avatar_driver_foobar', array('get_name'), array($config, $phpbb_root_path, $phpEx, $cache));
@@ -52,7 +52,7 @@ class phpbb_avatar_manager_test extends PHPUnit_Framework_TestCase
$config['allow_avatar_' . get_class($this->avatar_barfoo)] = false;
// Set up avatar manager
$this->manager = new phpbb_avatar_manager($config, $avatar_drivers, $this->phpbb_container);
$this->manager = new \phpbb\avatar\manager($config, $avatar_drivers, $this->phpbb_container);
}
protected function avatar_drivers()
@@ -203,7 +203,7 @@ class phpbb_avatar_manager_test extends PHPUnit_Framework_TestCase
{
$cleaned_row = array();
$cleaned_row = phpbb_avatar_manager::clean_row($input);
$cleaned_row = \phpbb\avatar\manager::clean_row($input);
foreach ($output as $key => $null)
{
$this->assertArrayHasKey($key, $cleaned_row);
@@ -222,7 +222,7 @@ class phpbb_avatar_manager_test extends PHPUnit_Framework_TestCase
public function test_localize_errors()
{
$user = $this->getMock('phpbb_user');
$user = $this->getMock('\phpbb\user');
$lang_array = array(
array('FOOBAR_OFF', 'foobar_off'),
array('FOOBAR_EXPLAIN', 'FOOBAR_EXPLAIN %s'),

View File

@@ -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();
}
}

View File

@@ -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);

View File

@@ -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()

View File

@@ -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);

View File

@@ -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();
}
}

View File

@@ -30,7 +30,7 @@ class phpbb_class_loader_test extends PHPUnit_Framework_TestCase
public function test_resolve_path()
{
$prefix = dirname(__FILE__) . '/';
$class_loader = new phpbb_class_loader('phpbb_', $prefix . 'phpbb/');
$class_loader = new \phpbb\class_loader('phpbb_', $prefix . 'phpbb/');
$prefix .= 'phpbb/';
@@ -71,8 +71,8 @@ class phpbb_class_loader_test extends PHPUnit_Framework_TestCase
$cache = new phpbb_mock_cache($cache_map);
$prefix = dirname(__FILE__) . '/';
$class_loader = new phpbb_class_loader('phpbb_', $prefix . 'phpbb/', 'php', $cache);
$class_loader_ext = new phpbb_class_loader('phpbb_ext_', $prefix . 'phpbb/', 'php', $cache);
$class_loader = new \phpbb\class_loader('phpbb_', $prefix . 'phpbb/', 'php', $cache);
$class_loader_ext = new \phpbb\class_loader('phpbb_ext_', $prefix . 'phpbb/', 'php', $cache);
$prefix .= 'phpbb/';

View File

@@ -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']));

View File

@@ -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']));
}

View File

@@ -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()

View File

@@ -267,21 +267,21 @@ class phpbb_content_visibility_delete_post_test extends phpbb_database_test_case
$config['search_type'] = 'phpbb_mock_search';
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
set_config_count(null, null, null, new phpbb_config(array('num_posts' => 3, 'num_topics' => 1)));
set_config_count(null, null, null, new \phpbb\config\config(array('num_posts' => 3, 'num_topics' => 1)));
// Create auth mock
$auth = $this->getMock('phpbb_auth');
$auth = $this->getMock('\phpbb\auth\auth');
$auth->expects($this->any())
->method('acl_get')
->with($this->stringContains('_'), $this->anything())
->will($this->returnValueMap(array(
array('m_approve', 1, true),
)));
$user = $this->getMock('phpbb_user');
$user = $this->getMock('\phpbb\user');
$phpbb_container = new phpbb_mock_container_builder();
$phpbb_container->set('notification_manager', new phpbb_mock_notification_manager());
$phpbb_container->set('content.visibility', new phpbb_content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE));
$phpbb_container->set('content.visibility', new \phpbb\content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE));
delete_post($forum_id, $topic_id, $post_id, $data, $is_soft, $reason);

View File

@@ -125,13 +125,13 @@ class phpbb_content_visibility_get_forums_visibility_sql_test extends phpbb_data
$db = $this->new_dbal();
// Create auth mock
$auth = $this->getMock('phpbb_auth');
$auth = $this->getMock('\phpbb\auth\auth');
$auth->expects($this->any())
->method('acl_getf')
->with($this->stringContains('_'), $this->anything())
->will($this->returnValueMap($permissions));
$user = $this->getMock('phpbb_user');
$content_visibility = new phpbb_content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
$user = $this->getMock('\phpbb\user');
$content_visibility = new \phpbb\content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
$result = $db->sql_query('SELECT ' . $mode . '_id
FROM ' . $table . '

View File

@@ -125,13 +125,13 @@ class phpbb_content_visibility_get_global_visibility_sql_test extends phpbb_data
$db = $this->new_dbal();
// Create auth mock
$auth = $this->getMock('phpbb_auth');
$auth = $this->getMock('\phpbb\auth\auth');
$auth->expects($this->any())
->method('acl_getf')
->with($this->stringContains('_'), $this->anything())
->will($this->returnValueMap($permissions));
$user = $this->getMock('phpbb_user');
$content_visibility = new phpbb_content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
$user = $this->getMock('\phpbb\user');
$content_visibility = new \phpbb\content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
$result = $db->sql_query('SELECT ' . $mode . '_id
FROM ' . $table . '

View File

@@ -72,13 +72,13 @@ class phpbb_content_visibility_get_visibility_sql_test extends phpbb_database_te
$db = $this->new_dbal();
// Create auth mock
$auth = $this->getMock('phpbb_auth');
$auth = $this->getMock('\phpbb\auth\auth');
$auth->expects($this->any())
->method('acl_get')
->with($this->stringContains('_'), $this->anything())
->will($this->returnValueMap($permissions));
$user = $this->getMock('phpbb_user');
$content_visibility = new phpbb_content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
$user = $this->getMock('\phpbb\user');
$content_visibility = new \phpbb\content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
$result = $db->sql_query('SELECT ' . $mode . '_id
FROM ' . $table . '

View File

@@ -119,9 +119,9 @@ class phpbb_content_visibility_set_post_visibility_test extends phpbb_database_t
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
$auth = $this->getMock('phpbb_auth');
$user = $this->getMock('phpbb_user');
$content_visibility = new phpbb_content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
$auth = $this->getMock('\phpbb\auth\auth');
$user = $this->getMock('\phpbb\user');
$content_visibility = new \phpbb\content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
$content_visibility->set_post_visibility($visibility, $post_id, $topic_id, $forum_id, $user_id, $time, $reason, $is_starter, $is_latest);

View File

@@ -83,9 +83,9 @@ class phpbb_content_visibility_set_topic_visibility_test extends phpbb_database_
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
$auth = $this->getMock('phpbb_auth');
$user = $this->getMock('phpbb_user');
$content_visibility = new phpbb_content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
$auth = $this->getMock('\phpbb\auth\auth');
$user = $this->getMock('\phpbb\user');
$content_visibility = new \phpbb\content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
$content_visibility->set_topic_visibility($visibility, $topic_id, $forum_id, $user_id, $time, $reason, $force_update_all);

View File

@@ -31,7 +31,7 @@ class phpbb_controller_controller_test extends phpbb_test_case
public function test_provider()
{
$provider = new phpbb_controller_provider;
$provider = new \phpbb\controller\provider;
$routes = $provider
->import_paths_from_finder($this->extension_manager->get_finder())
->find('./tests/controller/');
@@ -62,7 +62,7 @@ class phpbb_controller_controller_test extends phpbb_test_case
include(__DIR__.'/phpbb/controller/foo.php');
}
$resolver = new phpbb_controller_resolver(new phpbb_user, $container);
$resolver = new \phpbb\controller\resolver(new \phpbb\user, $container);
$symfony_request = new Request();
$symfony_request->attributes->set('_controller', 'foo.controller:handle');

View File

@@ -48,14 +48,14 @@ class phpbb_controller_helper_url_test extends phpbb_test_case
global $phpbb_dispatcher, $phpbb_root_path, $phpEx;
$phpbb_dispatcher = new phpbb_mock_event_dispatcher;
$this->style_resource_locator = new phpbb_style_resource_locator();
$this->user = $this->getMock('phpbb_user');
$this->template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $this->user, new phpbb_template_context());
$this->style_resource_locator = new phpbb_style_resource_locator();
$this->style_provider = new phpbb_style_path_provider();
$this->style = new phpbb_style($phpbb_root_path, $phpEx, new phpbb_config(array()), $this->user, $this->style_resource_locator, $this->style_provider, $this->template);
$this->style_resource_locator = new \phpbb\style\resource_locator();
$this->user = $this->getMock('\phpbb\user');
$this->template = new \phpbb\template\twig\twig($phpbb_root_path, $phpEx, $config, $this->user, new \phpbb\template\context());
$this->style_resource_locator = new \phpbb\style\resource_locator();
$this->style_provider = new \phpbb\style\path_provider();
$this->style = new \phpbb\style\style($phpbb_root_path, $phpEx, new \phpbb\config\config(array()), $this->user, $this->style_resource_locator, $this->style_provider, $this->template);
$helper = new phpbb_controller_helper($this->template, $this->user, '', 'php');
$helper = new \phpbb\controller\helper($this->template, $this->user, '', 'php');
$this->assertEquals($helper->url($route, $params, $is_amp, $session_id), $expected);
}
}

View File

@@ -7,7 +7,7 @@
*
*/
class phpbb_ext_testext_cron_dummy_task extends phpbb_cron_task_base
class phpbb_ext_testext_cron_dummy_task extends \phpbb\cron\task\base
{
static public $was_run = 0;

View File

@@ -7,7 +7,7 @@
*
*/
class phpbb_cron_task_core_dummy_task extends phpbb_cron_task_base
class phpbb_cron_task_core_dummy_task extends \phpbb\cron\task\base
{
static public $was_run = 0;

View File

@@ -7,7 +7,7 @@
*
*/
class phpbb_cron_task_core_second_dummy_task extends phpbb_cron_task_base
class phpbb_cron_task_core_second_dummy_task extends \phpbb\cron\task\base
{
static public $was_run = 0;

View File

@@ -29,7 +29,7 @@ class phpbb_cron_manager_test extends PHPUnit_Framework_TestCase
public function test_manager_finds_shipped_task_by_name()
{
$task = $this->manager->find_task($this->task_name);
$this->assertInstanceOf('phpbb_cron_task_wrapper', $task);
$this->assertInstanceOf('\phpbb\cron\task\wrapper', $task);
$this->assertEquals($this->task_name, $task->get_name());
}
@@ -42,7 +42,7 @@ class phpbb_cron_manager_test extends PHPUnit_Framework_TestCase
public function test_manager_finds_one_ready_task()
{
$task = $this->manager->find_one_ready_task();
$this->assertInstanceOf('phpbb_cron_task_wrapper', $task);
$this->assertInstanceOf('\phpbb\cron\task\wrapper', $task);
}
public function test_manager_finds_only_ready_tasks()
@@ -71,6 +71,6 @@ class phpbb_cron_manager_test extends PHPUnit_Framework_TestCase
{
global $phpbb_root_path, $phpEx;
return new phpbb_cron_manager($tasks, $phpbb_root_path, $phpEx);
return new \phpbb\cron\manager($tasks, $phpbb_root_path, $phpEx);
}
}

View File

@@ -1,6 +1,6 @@
<?php
class phpbb_cron_task_core_simple_not_runnable extends phpbb_cron_task_base
class phpbb_cron_task_core_simple_not_runnable extends \phpbb\cron\task\base
{
public function get_name()
{

View File

@@ -1,6 +1,6 @@
<?php
class phpbb_cron_task_core_simple_ready extends phpbb_cron_task_base
class phpbb_cron_task_core_simple_ready extends \phpbb\cron\task\base
{
public function get_name()
{

View File

@@ -1,6 +1,6 @@
<?php
class phpbb_cron_task_core_simple_should_not_run extends phpbb_cron_task_base
class phpbb_cron_task_core_simple_should_not_run extends \phpbb\cron\task\base
{
public function get_name()
{

View File

@@ -35,7 +35,7 @@ class phpbb_datetime_from_format_test extends phpbb_test_case
{
global $user;
$user = new phpbb_user();
$user = new \phpbb\user();
$user->timezone = new DateTimeZone($timezone);
$user->lang['datetime'] = array(
'TODAY' => 'Today',

View File

@@ -26,7 +26,7 @@ class phpbb_dbal_auto_increment_test extends phpbb_database_test_case
parent::setUp();
$this->db = $this->new_dbal();
$this->tools = new phpbb_db_tools($this->db);
$this->tools = new \phpbb\db\tools($this->db);
$this->table_data = array(
'COLUMNS' => array(

View File

@@ -19,13 +19,13 @@ class phpbb_dbal_case_test extends phpbb_database_test_case
$db = $this->new_dbal();
$sql = 'SELECT ' . $db->sql_case('1 = 1', '1', '2') . ' AS test_num
FROM phpbb_config';
FROM \phpbb\config\config';
$result = $db->sql_query_limit($sql, 1);
$this->assertEquals(1, (int) $db->sql_fetchfield('test_num'));
$sql = 'SELECT ' . $db->sql_case('1 = 0', '1', '2') . ' AS test_num
FROM phpbb_config';
FROM \phpbb\config\config';
$result = $db->sql_query_limit($sql, 1);
$this->assertEquals(2, (int) $db->sql_fetchfield('test_num'));
@@ -36,13 +36,13 @@ class phpbb_dbal_case_test extends phpbb_database_test_case
$db = $this->new_dbal();
$sql = 'SELECT ' . $db->sql_case('1 = 1', "'foo'", "'bar'") . ' AS test_string
FROM phpbb_config';
FROM \phpbb\config\config';
$result = $db->sql_query_limit($sql, 1);
$this->assertEquals('foo', $db->sql_fetchfield('test_string'));
$sql = 'SELECT ' . $db->sql_case('1 = 0', "'foo'", "'bar'") . ' AS test_string
FROM phpbb_config';
FROM \phpbb\config\config';
$result = $db->sql_query_limit($sql, 1);
$this->assertEquals('bar', $db->sql_fetchfield('test_string'));
@@ -53,14 +53,14 @@ class phpbb_dbal_case_test extends phpbb_database_test_case
$db = $this->new_dbal();
$sql = 'SELECT ' . $db->sql_case("config_name = 'config1'", 'config_name', 'config_value') . " AS test_string
FROM phpbb_config
FROM \phpbb\config\config
WHERE config_name = 'config1'";
$result = $db->sql_query_limit($sql, 1);
$this->assertEquals('config1', $db->sql_fetchfield('test_string'));
$sql = 'SELECT ' . $db->sql_case("config_name = 'config1'", 'config_name', 'config_value') . " AS test_string
FROM phpbb_config
FROM \phpbb\config\config
WHERE config_value = 'bar'";
$result = $db->sql_query_limit($sql, 1);

View File

@@ -19,7 +19,7 @@ class phpbb_dbal_concatenate_test extends phpbb_database_test_case
$db = $this->new_dbal();
$sql = 'SELECT config_name, ' . $db->sql_concatenate('config_name', "'" . $db->sql_escape('append') . "'") . ' AS string
FROM phpbb_config';
FROM \phpbb\config\config';
$result = $db->sql_query($sql);
$db->sql_return_on_error(false);
@@ -43,7 +43,7 @@ class phpbb_dbal_concatenate_test extends phpbb_database_test_case
$db = $this->new_dbal();
$sql = 'SELECT config_name, ' . $db->sql_concatenate('config_name', 'config_value') . ' AS string
FROM phpbb_config';
FROM \phpbb\config\config';
$result = $db->sql_query($sql);
$db->sql_return_on_error(false);

View File

@@ -26,7 +26,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
parent::setUp();
$this->db = $this->new_dbal();
$this->tools = new phpbb_db_tools($this->db);
$this->tools = new \phpbb\db\tools($this->db);
$this->table_data = array(
'COLUMNS' => array(
@@ -254,7 +254,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
public function test_peform_schema_changes_drop_tables()
{
$db_tools = $this->getMock('phpbb_db_tools', array(
$db_tools = $this->getMock('\phpbb\db\tools', array(
'sql_table_exists',
'sql_table_drop',
), array(&$this->db));
@@ -280,7 +280,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
public function test_peform_schema_changes_drop_columns()
{
$db_tools = $this->getMock('phpbb_db_tools', array(
$db_tools = $this->getMock('\phpbb\db\tools', array(
'sql_column_exists',
'sql_column_remove',
), array(&$this->db));

View File

@@ -7,7 +7,7 @@
*
*/
class phpbb_dbal_migration_dummy extends phpbb_db_migration
class phpbb_dbal_migration_dummy extends \phpbb\db\migration\migration
{
static public function depends_on()
{
@@ -18,7 +18,7 @@ class phpbb_dbal_migration_dummy extends phpbb_db_migration
{
return array(
'add_columns' => array(
'phpbb_config' => array(
'\phpbb\config\config' => array(
'extra_column' => array('UINT', 1),
),
),

View File

@@ -7,7 +7,7 @@
*
*/
class phpbb_dbal_migration_fail extends phpbb_db_migration
class phpbb_dbal_migration_fail extends \phpbb\db\migration\migration
{
function update_schema()
{

View File

@@ -7,7 +7,7 @@
*
*/
class phpbb_dbal_migration_if extends phpbb_db_migration
class phpbb_dbal_migration_if extends \phpbb\db\migration\migration
{
function update_schema()
{

View File

@@ -7,7 +7,7 @@
*
*/
class phpbb_dbal_migration_installed extends phpbb_db_migration
class phpbb_dbal_migration_installed extends \phpbb\db\migration\migration
{
function effectively_installed()
{

View File

@@ -7,7 +7,7 @@
*
*/
class phpbb_dbal_migration_recall extends phpbb_db_migration
class phpbb_dbal_migration_recall extends \phpbb\db\migration\migration
{
function update_schema()
{

View File

@@ -7,13 +7,13 @@
*
*/
class phpbb_dbal_migration_revert extends phpbb_db_migration
class phpbb_dbal_migration_revert extends \phpbb\db\migration\migration
{
function update_schema()
{
return array(
'add_columns' => array(
'phpbb_config' => array(
'\phpbb\config\config' => array(
'bar_column' => array('UINT', 1),
),
),
@@ -24,7 +24,7 @@ class phpbb_dbal_migration_revert extends phpbb_db_migration
{
return array(
'drop_columns' => array(
'phpbb_config' => array(
'\phpbb\config\config' => array(
'bar_column',
),
),

View File

@@ -7,7 +7,7 @@
*
*/
class phpbb_dbal_migration_revert_with_dependency extends phpbb_db_migration
class phpbb_dbal_migration_revert_with_dependency extends \phpbb\db\migration\migration
{
static public function depends_on()
{

View File

@@ -7,7 +7,7 @@
*
*/
class phpbb_dbal_migration_unfulfillable extends phpbb_db_migration
class phpbb_dbal_migration_unfulfillable extends \phpbb\db\migration\migration
{
static public function depends_on()
{

View File

@@ -33,15 +33,15 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
parent::setUp();
$this->db = $this->new_dbal();
$this->db_tools = new phpbb_db_tools($this->db);
$this->db_tools = new \phpbb\db\tools($this->db);
$this->config = new phpbb_config_db($this->db, new phpbb_mock_cache, 'phpbb_config');
$this->config = new \phpbb\config\db($this->db, new phpbb_mock_cache, '\phpbb\config\config');
$tools = array(
new phpbb_db_migration_tool_config($this->config),
new \phpbb\db\migration\tool\config($this->config),
);
$this->migrator = new phpbb_db_migrator(
$this->migrator = new \phpbb\db\migrator(
$this->config,
$this->db,
$this->db_tools,
@@ -55,11 +55,11 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
$container = new phpbb_mock_container_builder();
$container->set('migrator', $migrator);
$this->extension_manager = new phpbb_extension_manager(
$this->extension_manager = new \phpbb\extension\manager(
$container,
$this->db,
$this->config,
new phpbb_filesystem(),
new \phpbb\filesystem(),
'phpbb_ext',
dirname(__FILE__) . '/../../phpBB/',
'php',
@@ -91,7 +91,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
$this->assertSqlResultEquals(
array(array('extra_column' => '1')),
"SELECT extra_column FROM phpbb_config WHERE config_name = 'foo'",
"SELECT extra_column FROM \phpbb\config\config WHERE config_name = 'foo'",
'Dummy migration created extra_column with value 1 in all rows.'
);
@@ -107,7 +107,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
);
// cleanup
$this->db_tools->sql_column_remove('phpbb_config', 'extra_column');
$this->db_tools->sql_column_remove('\phpbb\config\config', 'extra_column');
}
public function test_unfulfillable()
@@ -123,11 +123,11 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
$this->assertSqlResultEquals(
array(array('extra_column' => '1')),
"SELECT extra_column FROM phpbb_config WHERE config_name = 'foo'",
"SELECT extra_column FROM \phpbb\config\config WHERE config_name = 'foo'",
'Dummy migration was run, even though an unfulfillable migration was found.'
);
$this->db_tools->sql_column_remove('phpbb_config', 'extra_column');
$this->db_tools->sql_column_remove('\phpbb\config\config', 'extra_column');
}
public function test_if()
@@ -192,7 +192,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
$this->assertSqlResultEquals(
array(array('bar_column' => '1')),
"SELECT bar_column FROM phpbb_config WHERE config_name = 'foo'",
"SELECT bar_column FROM \phpbb\config\config WHERE config_name = 'foo'",
'Installing revert migration failed to create bar_column.'
);
@@ -208,7 +208,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
$this->assertFalse(isset($this->config['foobartest']));
$sql = 'SELECT * FROM phpbb_config';
$sql = 'SELECT * FROM \phpbb\config\config';
$result = $this->db->sql_query_limit($sql, 1);
$row = $this->db->sql_fetchrow($result);
$this->db->sql_freeresult($result);
@@ -232,12 +232,12 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
$this->migrator->update();
}
}
catch (phpbb_db_migration_exception $e) {}
catch (\phpbb\db\migration\exception $e) {}
// Failure should have caused an automatic roll-back, so this should not exist.
$this->assertFalse(isset($this->config['foobar3']));
$sql = 'SELECT * FROM phpbb_config';
$sql = 'SELECT * FROM \phpbb\config\config';
$result = $this->db->sql_query_limit($sql, 1);
$row = $this->db->sql_fetchrow($result);
$this->db->sql_freeresult($result);

View File

@@ -11,9 +11,9 @@ class phpbb_dbal_migrator_tool_config_test extends phpbb_test_case
{
public function setup()
{
$this->config = new phpbb_config(array());
$this->config = new \phpbb\config\config(array());
$this->tool = new phpbb_db_migration_tool_config($this->config);
$this->tool = new \phpbb\db\migration\tool\config($this->config);
parent::setup();
}

View File

@@ -27,15 +27,15 @@ class phpbb_dbal_migrator_tool_module_test extends phpbb_database_test_case
$skip_add_log = true;
$db = $this->db = $this->new_dbal();
$this->cache = new phpbb_cache_service(new phpbb_cache_driver_null(), new phpbb_config(array()), $this->db, $phpbb_root_path, $phpEx);
$user = $this->user = new phpbb_user();
$this->cache = new \phpbb\cache\service(new \phpbb\cache\driver\null(), new \phpbb\config\config(array()), $this->db, $phpbb_root_path, $phpEx);
$user = $this->user = new \phpbb\user();
$cache = new phpbb_mock_cache;
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
$auth = $this->getMock('phpbb_auth');
$phpbb_log = new phpbb_log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
$auth = $this->getMock('\phpbb\auth\auth');
$phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
$this->tool = new phpbb_db_migration_tool_module($this->db, $this->cache, $this->user, $phpbb_root_path, $phpEx, 'phpbb_modules');
$this->tool = new \phpbb\db\migration\tool\module($this->db, $this->cache, $this->user, $phpbb_root_path, $phpEx, 'phpbb_modules');
}
public function exists_data()

View File

@@ -24,10 +24,10 @@ class phpbb_dbal_migrator_tool_permission_test extends phpbb_database_test_case
parent::setup();
$db = $this->db = $this->new_dbal();
$cache = $this->cache = new phpbb_cache_service(new phpbb_cache_driver_null(), new phpbb_config(array()), $this->db, $phpbb_root_path, $phpEx);
$this->auth = new phpbb_auth();
$cache = $this->cache = new \phpbb\cache\service(new \phpbb\cache\driver\null(), new \phpbb\config\config(array()), $this->db, $phpbb_root_path, $phpEx);
$this->auth = new \phpbb\auth\auth();
$this->tool = new phpbb_db_migration_tool_permission($this->db, $this->cache, $this->auth, $phpbb_root_path, $phpEx);
$this->tool = new \phpbb\db\migration\tool\permission($this->db, $this->cache, $this->auth, $phpbb_root_path, $phpEx);
}
public function exists_data()

View File

@@ -21,13 +21,13 @@ class phpbb_dbal_schema_test extends phpbb_database_test_case
$db = $this->new_dbal();
$value = str_repeat("\xC3\x84", 255);
$sql = "INSERT INTO phpbb_config
$sql = "INSERT INTO \phpbb\config\config
(config_name, config_value)
VALUES ('name', '$value')";
$result = $db->sql_query($sql);
$sql = "SELECT config_value
FROM phpbb_config
FROM \phpbb\config\config
WHERE config_name = 'name'";
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);

View File

@@ -17,7 +17,7 @@ class phpbb_dbal_sql_insert_buffer_test extends phpbb_database_test_case
parent::setUp();
$this->db = $this->new_dbal();
$this->buffer = new phpbb_db_sql_insert_buffer($this->db, 'phpbb_config', 2);
$this->buffer = new \phpbb\db\sql_insert_buffer($this->db, '\phpbb\config\config', 2);
$this->assert_config_count(2);
}
@@ -81,7 +81,7 @@ class phpbb_dbal_sql_insert_buffer_test extends phpbb_database_test_case
protected function assert_config_count($num_configs)
{
$sql = 'SELECT COUNT(*) AS num_configs
FROM phpbb_config';
FROM \phpbb\config\config';
$result = $this->db->sql_query($sql);
$this->assertEquals($num_configs, $this->db->sql_fetchfield('num_configs'));
$this->db->sql_freeresult($result);

View File

@@ -39,11 +39,11 @@ class phpbb_dbal_write_test extends phpbb_database_test_case
{
$db = $this->new_dbal();
$sql = 'INSERT INTO phpbb_config ' . $db->sql_build_array('INSERT', $sql_ary);
$sql = 'INSERT INTO \phpbb\config\config ' . $db->sql_build_array('INSERT', $sql_ary);
$result = $db->sql_query($sql);
$sql = "SELECT *
FROM phpbb_config
FROM \phpbb\config\config
WHERE config_name = '" . $sql_ary['config_name'] . "'";
$result = $db->sql_query_limit($sql, 1);
@@ -56,12 +56,12 @@ class phpbb_dbal_write_test extends phpbb_database_test_case
{
$db = $this->new_dbal();
$sql = "DELETE FROM phpbb_config
$sql = "DELETE FROM \phpbb\config\config
WHERE config_name = 'config1'";
$result = $db->sql_query($sql);
$sql = 'SELECT *
FROM phpbb_config';
FROM \phpbb\config\config';
$result = $db->sql_query($sql);
$rows = $db->sql_fetchrowset($result);
@@ -76,7 +76,7 @@ class phpbb_dbal_write_test extends phpbb_database_test_case
$db = $this->new_dbal();
// empty the table
$sql = 'DELETE FROM phpbb_config';
$sql = 'DELETE FROM \phpbb\config\config';
$db->sql_query($sql);
$batch_ary = array(
@@ -92,10 +92,10 @@ class phpbb_dbal_write_test extends phpbb_database_test_case
),
);
$result = $db->sql_multi_insert('phpbb_config', $batch_ary);
$result = $db->sql_multi_insert('\phpbb\config\config', $batch_ary);
$sql = 'SELECT *
FROM phpbb_config
FROM \phpbb\config\config
ORDER BY config_name ASC';
$result = $db->sql_query($sql);
@@ -155,12 +155,12 @@ class phpbb_dbal_write_test extends phpbb_database_test_case
{
$db = $this->new_dbal();
$sql = 'UPDATE phpbb_config
$sql = 'UPDATE \phpbb\config\config
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . $where;
$result = $db->sql_query($sql);
$sql = 'SELECT *
FROM phpbb_config
FROM \phpbb\config\config
ORDER BY config_name ASC';
$result = $db->sql_query($sql);

View File

@@ -16,8 +16,8 @@ class phpbb_di_container_test extends phpbb_test_case
{
$phpbb_root_path = __DIR__ . '/../../phpBB/';
$extensions = array(
new phpbb_di_extension_config(__DIR__ . '/fixtures/config.php'),
new phpbb_di_extension_core($phpbb_root_path),
new \phpbb\di\extension\config(__DIR__ . '/fixtures/config.php'),
new \phpbb\di\extension\core($phpbb_root_path),
);
$container = phpbb_create_container($extensions, $phpbb_root_path, 'php');
@@ -28,8 +28,8 @@ class phpbb_di_container_test extends phpbb_test_case
{
$phpbb_root_path = __DIR__ . '/../../phpBB/';
$extensions = array(
new phpbb_di_extension_config(__DIR__ . '/fixtures/config.php'),
new phpbb_di_extension_core($phpbb_root_path),
new \phpbb\di\extension\config(__DIR__ . '/fixtures/config.php'),
new \phpbb\di\extension\core($phpbb_root_path),
);
$container = phpbb_create_install_container($phpbb_root_path, 'php');
@@ -42,8 +42,8 @@ class phpbb_di_container_test extends phpbb_test_case
$phpbb_root_path = __DIR__ . '/../../phpBB/';
$config_file = __DIR__ . '/fixtures/config.php';
$extensions = array(
new phpbb_di_extension_config(__DIR__ . '/fixtures/config.php'),
new phpbb_di_extension_core($phpbb_root_path),
new \phpbb\di\extension\config(__DIR__ . '/fixtures/config.php'),
new \phpbb\di\extension\core($phpbb_root_path),
);
$container = phpbb_create_compiled_container($config_file, $extensions, array(), $phpbb_root_path, 'php');
@@ -52,7 +52,7 @@ class phpbb_di_container_test extends phpbb_test_case
}
}
class phpbb_db_driver_container_mock extends phpbb_db_driver
class phpbb_db_driver_container_mock extends \phpbb\db\driver\driver
{
public function sql_connect()
{

View File

@@ -8,4 +8,4 @@ $dbname = 'phpbb';
$dbuser = 'root';
$dbpasswd = '';
$table_prefix = 'phpbb_';
$acm_type = 'phpbb_cache_driver_null';
$acm_type = '\phpbb\cache\driver\null';

View File

@@ -13,7 +13,7 @@ class phpbb_error_collector_test extends phpbb_test_case
{
public function test_collection()
{
$collector = new phpbb_error_collector;
$collector = new \phpbb\error_collector;
$collector->install();
// Cause a warning

View File

@@ -11,9 +11,9 @@ class phpbb_event_dispatcher_test extends phpbb_test_case
{
public function test_trigger_event()
{
$dispatcher = new phpbb_event_dispatcher(new phpbb_mock_container_builder());
$dispatcher = new \phpbb\event\dispatcher(new phpbb_mock_container_builder());
$dispatcher->addListener('core.test_event', function (phpbb_event_data $event) {
$dispatcher->addListener('core.test_event', function (\phpbb\event\data $event) {
$event['foo'] = $event['foo'] . '2';
$event['bar'] = $event['bar'] . '2';
});

View File

@@ -1,6 +1,6 @@
<?php
class phpbb_ext_bar_ext extends phpbb_extension_base
class phpbb_ext_bar_ext extends \phpbb\extension\base
{
static public $state;

View File

@@ -1,5 +1,5 @@
<?php
class phpbb_ext_barfoo_ext extends phpbb_extension_base
class phpbb_ext_barfoo_ext extends \phpbb\extension\base
{
}

View File

@@ -1,6 +1,6 @@
<?php
class phpbb_ext_foo_ext extends phpbb_extension_base
class phpbb_ext_foo_ext extends \phpbb\extension\base
{
static public $disabled;

View File

@@ -1,6 +1,6 @@
<?php
class phpbb_ext_vendor_moo_ext extends phpbb_extension_base
class phpbb_ext_vendor_moo_ext extends \phpbb\extension\base
{
static public $purged;

View File

@@ -181,7 +181,7 @@ class phpbb_extension_finder_test extends phpbb_test_case
public function test_get_classes_create_cache()
{
$cache = new phpbb_mock_cache;
$finder = new phpbb_extension_finder($this->extension_manager, new phpbb_filesystem(), dirname(__FILE__) . '/', $cache, 'php', '_custom_cache_name');
$finder = new \phpbb\extension\finder($this->extension_manager, new \phpbb\filesystem(), dirname(__FILE__) . '/', $cache, 'php', '_custom_cache_name');
$files = $finder->suffix('_class.php')->get_files();
$expected_files = array(
@@ -219,9 +219,9 @@ class phpbb_extension_finder_test extends phpbb_test_case
'is_dir' => false,
);
$finder = new phpbb_extension_finder(
$finder = new \phpbb\extension\finder(
$this->extension_manager,
new phpbb_filesystem(),
new \phpbb\filesystem(),
dirname(__FILE__) . '/',
new phpbb_mock_cache(array(
'_ext_finder' => array(

View File

@@ -90,14 +90,14 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
protected function create_extension_manager($with_cache = true)
{
$config = new phpbb_config(array());
$config = new \phpbb\config\config(array());
$db = $this->new_dbal();
$db_tools = new phpbb_db_tools($db);
$db_tools = new \phpbb\db\tools($db);
$phpbb_root_path = __DIR__ . './../../phpBB/';
$php_ext = 'php';
$table_prefix = 'phpbb_';
$migrator = new phpbb_db_migrator(
$migrator = new \phpbb\db\migrator(
$config,
$db,
$db_tools,
@@ -110,11 +110,11 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
$container = new phpbb_mock_container_builder();
$container->set('migrator', $migrator);
return new phpbb_extension_manager(
return new \phpbb\extension\manager(
$container,
$db,
$config,
new phpbb_filesystem(),
new \phpbb\filesystem(),
'phpbb_ext',
dirname(__FILE__) . '/',
$php_ext,

View File

@@ -30,25 +30,25 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
parent::setUp();
$this->cache = new phpbb_mock_cache();
$this->config = new phpbb_config(array(
$this->config = new \phpbb\config\config(array(
'version' => '3.1.0',
));
$this->db = $this->new_dbal();
$this->db_tools = new phpbb_db_tools($this->db);
$this->db_tools = new \phpbb\db\tools($this->db);
$this->phpbb_root_path = dirname(__FILE__) . '/';
$this->phpEx = 'php';
$this->user = new phpbb_user();
$this->user = new \phpbb\user();
$this->table_prefix = 'phpbb_';
$this->template = new phpbb_template_twig(
$this->template = new \phpbb\template\twig\twig(
$this->phpbb_root_path,
$this->phpEx,
$this->config,
$this->user,
new phpbb_template_context()
new \phpbb\template\context()
);
$this->migrator = new phpbb_db_migrator(
$this->migrator = new \phpbb\db\migrator(
$this->config,
$this->db,
$this->db_tools,
@@ -61,11 +61,11 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$container = new phpbb_mock_container_builder();
$container->set('migrator', $migrator);
$this->extension_manager = new phpbb_extension_manager(
$this->extension_manager = new \phpbb\extension\manager(
$container,
$this->db,
$this->config,
new phpbb_filesystem(),
new \phpbb\filesystem(),
'phpbb_ext',
$this->phpbb_root_path,
$this->phpEx,
@@ -84,7 +84,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
{
$manager->get_metadata();
}
catch(phpbb_extension_exception $e){}
catch(\phpbb\extension\exception $e){}
$this->assertEquals((string) $e, 'The required file does not exist: ' . $this->phpbb_root_path . $this->extension_manager->get_extension_path($ext_name) . 'composer.json');
}
@@ -100,7 +100,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
{
$metadata = $manager->get_metadata();
}
catch(phpbb_extension_exception $e)
catch(\phpbb\extension\exception $e)
{
$this->fail($e);
}
@@ -123,7 +123,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->fail('Exception not triggered');
}
catch(phpbb_extension_exception $e)
catch(\phpbb\extension\exception $e)
{
$this->assertEquals((string) $e, 'Required meta field \'name\' has not been set.');
}
@@ -134,7 +134,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->fail('Exception not triggered');
}
catch(phpbb_extension_exception $e)
catch(\phpbb\extension\exception $e)
{
$this->assertEquals((string) $e, 'Required meta field \'type\' has not been set.');
}
@@ -145,7 +145,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->fail('Exception not triggered');
}
catch(phpbb_extension_exception $e)
catch(\phpbb\extension\exception $e)
{
$this->assertEquals((string) $e, 'Required meta field \'licence\' has not been set.');
}
@@ -156,7 +156,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->fail('Exception not triggered');
}
catch(phpbb_extension_exception $e)
catch(\phpbb\extension\exception $e)
{
$this->assertEquals((string) $e, 'Required meta field \'version\' has not been set.');
}
@@ -167,7 +167,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->fail('Exception not triggered');
}
catch(phpbb_extension_exception $e)
catch(\phpbb\extension\exception $e)
{
$this->assertEquals((string) $e, 'Required meta field \'authors\' has not been set.');
}
@@ -184,7 +184,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->fail('Exception not triggered');
}
catch(phpbb_extension_exception $e)
catch(\phpbb\extension\exception $e)
{
$this->assertEquals((string) $e, 'Required meta field \'author name\' has not been set.');
}
@@ -211,7 +211,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->fail('Exception not triggered');
}
catch(phpbb_extension_exception $e)
catch(\phpbb\extension\exception $e)
{
$this->assertEquals((string) $e, 'Meta field \'name\' is invalid.');
}
@@ -222,7 +222,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->fail('Exception not triggered');
}
catch(phpbb_extension_exception $e)
catch(\phpbb\extension\exception $e)
{
$this->assertEquals((string) $e, 'Meta field \'type\' is invalid.');
}
@@ -233,7 +233,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->fail('Exception not triggered');
}
catch(phpbb_extension_exception $e)
catch(\phpbb\extension\exception $e)
{
$this->assertEquals((string) $e, 'Meta field \'licence\' is invalid.');
}
@@ -244,7 +244,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->fail('Exception not triggered');
}
catch(phpbb_extension_exception $e)
catch(\phpbb\extension\exception $e)
{
$this->assertEquals((string) $e, 'Meta field \'version\' is invalid.');
}
@@ -268,7 +268,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
{
$this->assertEquals(true, $manager->validate('enable'));
}
catch(phpbb_extension_exception $e)
catch(\phpbb\extension\exception $e)
{
$this->fail($e);
}
@@ -293,7 +293,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->assertEquals(false, $manager->validate_require_php());
$this->assertEquals(false, $manager->validate_require_phpbb());
}
catch(phpbb_extension_exception $e)
catch(\phpbb\extension\exception $e)
{
$this->fail($e);
}
@@ -312,7 +312,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->assertEquals(true, $manager->validate_require_php());
$this->assertEquals(true, $manager->validate_require_phpbb());
}
catch(phpbb_extension_exception $e)
catch(\phpbb\extension\exception $e)
{
$this->fail($e);
}
@@ -331,7 +331,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->assertEquals(false, $manager->validate_require_php());
$this->assertEquals(false, $manager->validate_require_phpbb());
}
catch(phpbb_extension_exception $e)
catch(\phpbb\extension\exception $e)
{
$this->fail($e);
}
@@ -350,7 +350,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->assertEquals(false, $manager->validate_require_php());
$this->assertEquals(false, $manager->validate_require_phpbb());
}
catch(phpbb_extension_exception $e)
catch(\phpbb\extension\exception $e)
{
$this->fail($e);
}
@@ -369,7 +369,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->assertEquals(true, $manager->validate_require_php());
$this->assertEquals(true, $manager->validate_require_phpbb());
}
catch(phpbb_extension_exception $e)
catch(\phpbb\extension\exception $e)
{
$this->fail($e);
}
@@ -388,7 +388,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->assertEquals(true, $manager->validate_require_php());
$this->assertEquals(true, $manager->validate_require_phpbb());
}
catch(phpbb_extension_exception $e)
catch(\phpbb\extension\exception $e)
{
$this->fail($e);
}
@@ -407,7 +407,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->assertEquals(true, $manager->validate_require_php());
$this->assertEquals(true, $manager->validate_require_phpbb());
}
catch(phpbb_extension_exception $e)
catch(\phpbb\extension\exception $e)
{
$this->fail($e);
}

View File

@@ -21,9 +21,9 @@ class phpbb_extension_style_path_provider_test extends phpbb_test_case
public function test_find()
{
$phpbb_style_path_provider = new phpbb_style_path_provider();
$phpbb_style_path_provider = new \phpbb\style\path_provider();
$phpbb_style_path_provider->set_styles(array($this->relative_root_path . 'styles/prosilver'));
$phpbb_style_extension_path_provider = new phpbb_style_extension_path_provider(new phpbb_mock_extension_manager(
$phpbb_style_extension_path_provider = new \phpbb\style\extension_path_provider(new phpbb_mock_extension_manager(
$this->root_path,
array(
'foo' => array(

View File

@@ -14,7 +14,7 @@ class phpbb_filesystem_clean_path_test extends phpbb_test_case
public function setUp()
{
parent::setUp();
$this->filesystem = new phpbb_filesystem();
$this->filesystem = new \phpbb\filesystem();
}
public function clean_path_data()

View File

@@ -91,12 +91,12 @@ class phpbb_functional_acp_permissions_test extends phpbb_functional_test_case
$crawler = self::request('GET', "adm/index.php?i=acp_permissions&icat=16&mode=$mode&${object_name}[0]=$object_id&type=$permission_type&sid=" . $this->sid);
$this->assertContains($this->lang('ACL_SET'), $crawler->filter('h1')->eq(1)->text());
// XXX globals for phpbb_auth, refactor it later
// XXX globals for \phpbb\auth\auth, refactor it later
global $db, $cache;
$db = $this->get_db();
$cache = new phpbb_mock_null_cache;
$auth = new phpbb_auth;
$auth = new \phpbb\auth\auth;
// XXX hardcoded id
$user_data = $auth->obtain_user_data(2);
$auth->acl($user_data);
@@ -114,7 +114,7 @@ class phpbb_functional_acp_permissions_test extends phpbb_functional_test_case
$this->assertContains($this->lang('AUTH_UPDATED'), $crawler->text());
// check acl again
$auth = new phpbb_auth;
$auth = new \phpbb\auth\auth;
// XXX hardcoded id
$user_data = $auth->obtain_user_data(2);
$auth->acl($user_data);

View File

@@ -5,7 +5,7 @@ class phpbb_ext_foo_bar_controller
{
protected $template;
public function __construct(phpbb_controller_helper $helper, phpbb_template $template)
public function __construct(\phpbb\controller\helper $helper, \phpbb\template\template $template)
{
$this->template = $template;
$this->helper = $helper;
@@ -30,6 +30,6 @@ class phpbb_ext_foo_bar_controller
public function exception()
{
throw new phpbb_controller_exception('Exception thrown from foo/exception route');
throw new \phpbb\controller\exception('Exception thrown from foo/exception route');
}
}

View File

@@ -1,6 +1,6 @@
<?php
class phpbb_ext_foo_bar_ext extends phpbb_extension_base
class phpbb_ext_foo_bar_ext extends \phpbb\extension\base
{
}

View File

@@ -160,7 +160,7 @@ class phpbb_functions_obtain_online_test extends phpbb_database_test_case
$config['load_online_guests'] = $display_guests;
$user = new phpbb_mock_lang();
$user->lang = $this->load_language();
$auth = $this->getMock('phpbb_auth');
$auth = $this->getMock('\phpbb\auth\auth');
$acl_get_map = array(
array('u_viewonline', true),
array('u_viewprofile', true),

View File

@@ -131,17 +131,17 @@ class phpbb_functions_user_group_user_attributes_test extends phpbb_database_tes
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
$auth = $this->getMock('phpbb_auth');
$auth = $this->getMock('\phpbb\auth\auth');
$auth->expects($this->any())
->method('acl_clear_prefetch');
$cache_driver = new phpbb_cache_driver_null();
$cache_driver = new \phpbb\cache\driver\null();
$phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
$phpbb_container
->expects($this->any())
->method('get')
->with('cache.driver')
->will($this->returnValue($cache_driver));
$phpbb_log = new phpbb_log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
$phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
group_user_attributes('default', $group_id, array($user_id), false, 'group_name', $group_row);

View File

@@ -20,7 +20,7 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case
return array(
array(1, 0, ''),
array(3, 2, ''),
array(4, 0, 'phpbb_groupposition_exception'),
array(4, 0, '\phpbb\groupposition\exception'),
);
}
@@ -33,7 +33,7 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
$user = new phpbb_user;
$user = new \phpbb\user;
$user->lang = array();
if ($throws_exception)
@@ -41,7 +41,7 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case
$this->setExpectedException($throws_exception);
}
$test_class = new phpbb_groupposition_legend($db, $user);
$test_class = new \phpbb\groupposition\legend($db, $user);
$this->assertEquals($expected, $test_class->get_group_value($group_id));
}
@@ -51,10 +51,10 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
$user = new phpbb_user;
$user = new \phpbb\user;
$user->lang = array();
$test_class = new phpbb_groupposition_legend($db, $user);
$test_class = new \phpbb\groupposition\legend($db, $user);
$this->assertEquals(2, $test_class->get_group_count());
}
@@ -91,10 +91,10 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
$user = new phpbb_user;
$user = new \phpbb\user;
$user->lang = array();
$test_class = new phpbb_groupposition_legend($db, $user);
$test_class = new \phpbb\groupposition\legend($db, $user);
$this->assertEquals($expected_added, $test_class->add_group($group_id));
$result = $db->sql_query('SELECT group_id, group_legend
@@ -179,10 +179,10 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
$user = new phpbb_user;
$user = new \phpbb\user;
$user->lang = array();
$test_class = new phpbb_groupposition_legend($db, $user);
$test_class = new \phpbb\groupposition\legend($db, $user);
$this->assertEquals($expected_deleted, $test_class->delete_group($group_id, $skip_group));
$result = $db->sql_query('SELECT group_id, group_legend
@@ -234,10 +234,10 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
$user = new phpbb_user;
$user = new \phpbb\user;
$user->lang = array();
$test_class = new phpbb_groupposition_legend($db, $user);
$test_class = new \phpbb\groupposition\legend($db, $user);
$this->assertEquals($excepted_moved, $test_class->move_up($group_id));
$result = $db->sql_query('SELECT group_id, group_legend
@@ -289,10 +289,10 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
$user = new phpbb_user;
$user = new \phpbb\user;
$user->lang = array();
$test_class = new phpbb_groupposition_legend($db, $user);
$test_class = new \phpbb\groupposition\legend($db, $user);
$this->assertEquals($excepted_moved, $test_class->move_down($group_id));
$result = $db->sql_query('SELECT group_id, group_legend
@@ -387,10 +387,10 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
$user = new phpbb_user;
$user = new \phpbb\user;
$user->lang = array();
$test_class = new phpbb_groupposition_legend($db, $user);
$test_class = new \phpbb\groupposition\legend($db, $user);
$this->assertEquals($excepted_moved, $test_class->move($group_id, $increment));
$result = $db->sql_query('SELECT group_id, group_legend

View File

@@ -22,7 +22,7 @@ class phpbb_groupposition_teampage_test extends phpbb_database_test_case
return array(
array(2, 3, ''),
array(6, 8, ''),
array(10, 0, 'phpbb_groupposition_exception'),
array(10, 0, '\phpbb\groupposition\exception'),
);
}
@@ -35,7 +35,7 @@ class phpbb_groupposition_teampage_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
$user = new phpbb_user;
$user = new \phpbb\user;
$user->lang = array();
if ($throws_exception)
@@ -43,7 +43,7 @@ class phpbb_groupposition_teampage_test extends phpbb_database_test_case
$this->setExpectedException($throws_exception);
}
$test_class = new phpbb_groupposition_teampage($db, $user, $cache);
$test_class = new \phpbb\groupposition\teampage($db, $user, $cache);
$this->assertEquals($expected, $test_class->get_group_value($group_id));
}
@@ -53,10 +53,10 @@ class phpbb_groupposition_teampage_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
$user = new phpbb_user;
$user = new \phpbb\user;
$user->lang = array();
$test_class = new phpbb_groupposition_teampage($db, $user, $cache);
$test_class = new \phpbb\groupposition\teampage($db, $user, $cache);
$this->assertEquals(8, $test_class->get_group_count());
}
@@ -137,10 +137,10 @@ class phpbb_groupposition_teampage_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
$user = new phpbb_user;
$user = new \phpbb\user;
$user->lang = array();
$test_class = new phpbb_groupposition_teampage($db, $user, $cache);
$test_class = new \phpbb\groupposition\teampage($db, $user, $cache);
$this->assertEquals($expected_added, $test_class->add_group_teampage($group_id, $parent_id));
$result = $db->sql_query('SELECT teampage_position, group_id, teampage_parent, teampage_name
@@ -180,10 +180,10 @@ class phpbb_groupposition_teampage_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
$user = new phpbb_user;
$user = new \phpbb\user;
$user->lang = array();
$test_class = new phpbb_groupposition_teampage($db, $user, $cache);
$test_class = new \phpbb\groupposition\teampage($db, $user, $cache);
$this->assertEquals($expected_added, $test_class->add_category_teampage($group_name));
$result = $db->sql_query('SELECT teampage_position, group_id, teampage_parent, teampage_name
@@ -247,10 +247,10 @@ class phpbb_groupposition_teampage_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
$user = new phpbb_user;
$user = new \phpbb\user;
$user->lang = array();
$test_class = new phpbb_groupposition_teampage($db, $user, $cache);
$test_class = new \phpbb\groupposition\teampage($db, $user, $cache);
$this->assertEquals($expected_deleted, $test_class->delete_group($group_id, false));
$result = $db->sql_query('SELECT teampage_position, group_id, teampage_parent, teampage_name
@@ -299,10 +299,10 @@ class phpbb_groupposition_teampage_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
$user = new phpbb_user;
$user = new \phpbb\user;
$user->lang = array();
$test_class = new phpbb_groupposition_teampage($db, $user, $cache);
$test_class = new \phpbb\groupposition\teampage($db, $user, $cache);
$this->assertEquals($expected_deleted, $test_class->delete_teampage($teampage_id, false));
$result = $db->sql_query('SELECT teampage_position, group_id, teampage_parent, teampage_name
@@ -462,10 +462,10 @@ class phpbb_groupposition_teampage_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
$user = new phpbb_user;
$user = new \phpbb\user;
$user->lang = array();
$test_class = new phpbb_groupposition_teampage($db, $user, $cache);
$test_class = new \phpbb\groupposition\teampage($db, $user, $cache);
$this->assertEquals($excepted_moved, $test_class->move($group_id, $move_delta));
$result = $db->sql_query('SELECT teampage_position, group_id, teampage_parent, teampage_name
@@ -625,10 +625,10 @@ class phpbb_groupposition_teampage_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
$user = new phpbb_user;
$user = new \phpbb\user;
$user->lang = array();
$test_class = new phpbb_groupposition_teampage($db, $user, $cache);
$test_class = new \phpbb\groupposition\teampage($db, $user, $cache);
$this->assertEquals($excepted_moved, $test_class->move_teampage($teampage_id, $move_delta));
$result = $db->sql_query('SELECT teampage_position, group_id, teampage_parent, teampage_name

View File

@@ -25,9 +25,9 @@ class phpbb_lock_db_test extends phpbb_database_test_case
global $db, $config;
$db = $this->db = $this->new_dbal();
$config = $this->config = new phpbb_config(array('rand_seed' => '', 'rand_seed_last_update' => '0'));
$config = $this->config = new \phpbb\config\config(array('rand_seed' => '', 'rand_seed_last_update' => '0'));
set_config(null, null, null, $this->config);
$this->lock = new phpbb_lock_db('test_lock', $this->config, $this->db);
$this->lock = new \phpbb\lock\db('test_lock', $this->config, $this->db);
}
public function test_new_lock()
@@ -38,7 +38,7 @@ class phpbb_lock_db_test extends phpbb_database_test_case
$this->assertTrue($this->lock->owns_lock());
$this->assertTrue(isset($this->config['test_lock']), 'Lock was created');
$lock2 = new phpbb_lock_db('test_lock', $this->config, $this->db);
$lock2 = new \phpbb\lock\db('test_lock', $this->config, $this->db);
$this->assertFalse($lock2->acquire());
$this->assertFalse($lock2->owns_lock());
@@ -49,7 +49,7 @@ class phpbb_lock_db_test extends phpbb_database_test_case
public function test_expire_lock()
{
$lock = new phpbb_lock_db('foo_lock', $this->config, $this->db);
$lock = new \phpbb\lock\db('foo_lock', $this->config, $this->db);
$this->assertTrue($lock->acquire());
}
@@ -82,7 +82,7 @@ class phpbb_lock_db_test extends phpbb_database_test_case
$this->assertFalse($this->lock->owns_lock());
$this->assertEquals('0', $this->config['test_lock'], 'First lock is released');
$lock2 = new phpbb_lock_db('test_lock', $this->config, $this->db);
$lock2 = new \phpbb\lock\db('test_lock', $this->config, $this->db);
$this->assertTrue($lock2->acquire());
$this->assertTrue($lock2->owns_lock());
$this->assertFalse(empty($this->config['test_lock']), 'Second lock is acquired');

View File

@@ -13,7 +13,7 @@ class phpbb_lock_flock_test extends phpbb_test_case
{
$path = __DIR__ . '/../tmp/precious';
$lock = new phpbb_lock_flock($path);
$lock = new \phpbb\lock\flock($path);
$ok = $lock->acquire();
$this->assertTrue($ok);
$lock->release();
@@ -23,7 +23,7 @@ class phpbb_lock_flock_test extends phpbb_test_case
{
$path = __DIR__ . '/../tmp/precious';
$lock = new phpbb_lock_flock($path);
$lock = new \phpbb\lock\flock($path);
$ok = $lock->acquire();
$this->assertTrue($ok);
$this->assertTrue($lock->owns_lock());
@@ -48,11 +48,11 @@ class phpbb_lock_flock_test extends phpbb_test_case
{
$path = __DIR__ . '/../tmp/precious';
$lock1 = new phpbb_lock_flock($path);
$lock1 = new \phpbb\lock\flock($path);
$ok = $lock1->acquire();
$this->assertTrue($ok);
$lock2 = new phpbb_lock_flock($path);
$lock2 = new \phpbb\lock\flock($path);
$ok = $lock2->acquire();
$this->assertFalse($ok);
@@ -78,7 +78,7 @@ class phpbb_lock_flock_test extends phpbb_test_case
// wait 0.5 s, acquire the lock, note how long it took
sleep(1);
$lock = new phpbb_lock_flock($path);
$lock = new \phpbb\lock\flock($path);
$start = time();
$ok = $lock->acquire();
$delta = time() - $start;
@@ -105,7 +105,7 @@ class phpbb_lock_flock_test extends phpbb_test_case
{
// child
// immediately acquire the lock and sleep for 2 s
$lock = new phpbb_lock_flock($path);
$lock = new \phpbb\lock\flock($path);
$ok = $lock->acquire();
$this->assertTrue($ok);
$this->assertTrue($lock->owns_lock());

View File

@@ -23,10 +23,10 @@ class phpbb_log_add_test extends phpbb_database_test_case
$db = $this->new_dbal();
$cache = new phpbb_mock_cache;
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
$user = $this->getMock('phpbb_user');
$auth = $this->getMock('phpbb_auth');
$user = $this->getMock('\phpbb\user');
$auth = $this->getMock('\phpbb\auth\auth');
$log = new phpbb_log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
$log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
$this->assertTrue($log->is_enabled(), 'Initialise failed');
@@ -52,10 +52,10 @@ class phpbb_log_add_test extends phpbb_database_test_case
$db = $this->new_dbal();
$cache = new phpbb_mock_cache;
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
$user = $this->getMock('phpbb_user');
$auth = $this->getMock('phpbb_auth');
$user = $this->getMock('\phpbb\user');
$auth = $this->getMock('\phpbb\auth\auth');
$log = new phpbb_log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
$log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
$mode = 'critical';
$user_id = ANONYMOUS;

View File

@@ -157,10 +157,10 @@ class phpbb_log_function_add_log_test extends phpbb_database_test_case
$db = $this->new_dbal();
$cache = new phpbb_mock_cache;
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
$user = $this->getMock('phpbb_user');
$auth = $this->getMock('phpbb_auth');
$user = $this->getMock('\phpbb\user');
$auth = $this->getMock('\phpbb\auth\auth');
$phpbb_log = new phpbb_log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
$phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
$user->ip = 'user_ip';
if ($user_id)

View File

@@ -306,7 +306,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
// Create auth mock
$auth = $this->getMock('phpbb_auth');
$auth = $this->getMock('\phpbb\auth\auth');
$acl_get_map = array(
array('f_read', 23, true),
array('m_', 23, true),
@@ -333,7 +333,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
'LOG_INSTALL_INSTALLED' => 'installed: %s',
);
$phpbb_log = new phpbb_log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
$phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
$log = array();
$this->assertEquals($expected_returned, view_log($mode, $log, $log_count, $limit, $offset, $forum_id, $topic_id, $user_id, $limit_days, $sort_by, $keywords));

View File

@@ -7,7 +7,7 @@
*
*/
class phpbb_mock_cache implements phpbb_cache_driver_driver_interface
class phpbb_mock_cache implements \phpbb\cache\driver\driver_interface
{
protected $data;
@@ -140,7 +140,7 @@ class phpbb_mock_cache implements phpbb_cache_driver_driver_interface
/**
* {@inheritDoc}
*/
public function sql_save(phpbb_db_driver $db, $query, $query_result, $ttl)
public function sql_save(\phpbb\db\driver\driver $db, $query, $query_result, $ttl)
{
return $query_result;
}

View File

@@ -7,13 +7,13 @@
*
*/
class phpbb_mock_extension_manager extends phpbb_extension_manager
class phpbb_mock_extension_manager extends \phpbb\extension\manager
{
public function __construct($phpbb_root_path, $extensions = array())
{
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = 'php';
$this->extensions = $extensions;
$this->filesystem = new phpbb_filesystem();
$this->filesystem = new \phpbb\filesystem();
}
}

View File

@@ -7,7 +7,7 @@
*
*/
class phpbb_mock_metadata_manager extends phpbb_extension_metadata_manager
class phpbb_mock_metadata_manager extends \phpbb\extension\metadata_manager
{
public function set_metadata($metadata)
{

View File

@@ -7,7 +7,7 @@
*
*/
class phpbb_mock_notifications_auth extends phpbb_auth
class phpbb_mock_notifications_auth extends \phpbb\auth\auth
{
function acl_get_list($user_id = false, $opts = false, $forum_id = false)
{

View File

@@ -7,33 +7,33 @@
*
*/
class phpbb_mock_request implements phpbb_request_request_interface
class phpbb_mock_request implements \phpbb\request\request_interface
{
protected $data;
public function __construct($get = array(), $post = array(), $cookie = array(), $server = array(), $request = false, $files = array())
{
$this->data[phpbb_request_request_interface::GET] = $get;
$this->data[phpbb_request_request_interface::POST] = $post;
$this->data[phpbb_request_request_interface::COOKIE] = $cookie;
$this->data[phpbb_request_request_interface::REQUEST] = ($request === false) ? $post + $get : $request;
$this->data[phpbb_request_request_interface::SERVER] = $server;
$this->data[phpbb_request_request_interface::FILES] = $files;
$this->data[\phpbb\request\request_interface::GET] = $get;
$this->data[\phpbb\request\request_interface::POST] = $post;
$this->data[\phpbb\request\request_interface::COOKIE] = $cookie;
$this->data[\phpbb\request\request_interface::REQUEST] = ($request === false) ? $post + $get : $request;
$this->data[\phpbb\request\request_interface::SERVER] = $server;
$this->data[\phpbb\request\request_interface::FILES] = $files;
}
public function overwrite($var_name, $value, $super_global = phpbb_request_request_interface::REQUEST)
public function overwrite($var_name, $value, $super_global = \phpbb\request\request_interface::REQUEST)
{
$this->data[$super_global][$var_name] = $value;
}
public function variable($var_name, $default, $multibyte = false, $super_global = phpbb_request_request_interface::REQUEST)
public function variable($var_name, $default, $multibyte = false, $super_global = \phpbb\request\request_interface::REQUEST)
{
return isset($this->data[$super_global][$var_name]) ? $this->data[$super_global][$var_name] : $default;
}
public function server($var_name, $default = '')
{
$super_global = phpbb_request_request_interface::SERVER;
$super_global = \phpbb\request\request_interface::SERVER;
return isset($this->data[$super_global][$var_name]) ? $this->data[$super_global][$var_name] : $default;
}
@@ -45,16 +45,16 @@ class phpbb_mock_request implements phpbb_request_request_interface
public function file($form_name)
{
$super_global = phpbb_request_request_interface::FILES;
$super_global = \phpbb\request\request_interface::FILES;
return isset($this->data[$super_global][$form_name]) ? $this->data[$super_global][$form_name] : array();
}
public function is_set_post($name)
{
return $this->is_set($name, phpbb_request_request_interface::POST);
return $this->is_set($name, \phpbb\request\request_interface::POST);
}
public function is_set($var, $super_global = phpbb_request_request_interface::REQUEST)
public function is_set($var, $super_global = \phpbb\request\request_interface::REQUEST)
{
return isset($this->data[$super_global][$var]);
}
@@ -69,7 +69,7 @@ class phpbb_mock_request implements phpbb_request_request_interface
return false;
}
public function variable_names($super_global = phpbb_request_request_interface::REQUEST)
public function variable_names($super_global = \phpbb\request\request_interface::REQUEST)
{
return array_keys($this->data[$super_global]);
}
@@ -79,10 +79,10 @@ class phpbb_mock_request implements phpbb_request_request_interface
public function set_header($header_name, $value)
{
$var_name = 'HTTP_' . str_replace('-', '_', strtoupper($header_name));
$this->data[phpbb_request_request_interface::SERVER][$var_name] = $value;
$this->data[\phpbb\request\request_interface::SERVER][$var_name] = $value;
}
public function merge($super_global = phpbb_request_request_interface::REQUEST, $values)
public function merge($super_global = \phpbb\request\request_interface::REQUEST, $values)
{
$this->data[$super_global] = array_merge($this->data[$super_global], $values);
}

View File

@@ -16,7 +16,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
* test it without warnings about sent headers. This class only stores cookie
* data for later verification.
*/
class phpbb_mock_session_testable extends phpbb_session
class phpbb_mock_session_testable extends \phpbb\session
{
private $_cookies = array();

View File

@@ -7,7 +7,7 @@
*
*/
class phpbb_mock_sql_insert_buffer extends phpbb_db_sql_insert_buffer
class phpbb_mock_sql_insert_buffer extends \phpbb\db\sql_insert_buffer
{
public function flush()
{

View File

@@ -25,10 +25,10 @@ class phpbb_notification_convert_test extends phpbb_database_test_case
$this->db = $this->new_dbal();
$this->migration = new phpbb_db_migration_data_310_notification_options_reconvert(
new phpbb_config(array()),
$this->migration = new \phpbb\db\migration\data0\notification_options_reconvert(
new \phpbb\config\config(array()),
$this->db,
new phpbb_db_tools($this->db),
new \phpbb\db\tools($this->db),
$phpbb_root_path,
$phpEx,
'phpbb_'

View File

@@ -15,7 +15,7 @@ if (!defined('IN_PHPBB'))
exit;
}
class phpbb_notification_type_test extends phpbb_notification_type_base
class phpbb_notification_type_test extends \phpbb\notification\type\base
{
public function get_type()
{

View File

@@ -19,7 +19,7 @@ if (!defined('IN_PHPBB'))
* Notifications service class
* @package notifications
*/
class phpbb_notification_manager_helper extends phpbb_notification_manager
class phpbb_notification_manager_helper extends \phpbb\notification\manager
{
public function set_var($name, $value)
{

View File

@@ -27,17 +27,17 @@ class phpbb_notification_test extends phpbb_database_test_case
include_once(__DIR__ . '/ext/test/notification/type/test.' . $phpEx);
$this->db = $this->new_dbal();
$this->config = new phpbb_config(array(
$this->config = new \phpbb\config\config(array(
'allow_privmsg' => true,
'allow_bookmarks' => true,
'allow_topic_notify' => true,
'allow_forum_notify' => true,
));
$this->user = new phpbb_user();
$this->user_loader = new phpbb_user_loader($this->db, $phpbb_root_path, $phpEx, 'phpbb_users');
$this->user = new \phpbb\user();
$this->user_loader = new \phpbb\user_loader($this->db, $phpbb_root_path, $phpEx, 'phpbb_users');
$this->auth = new phpbb_mock_notifications_auth();
$this->cache = new phpbb_cache_service(
new phpbb_cache_driver_null(),
$this->cache = new \phpbb\cache\service(
new \phpbb\cache\driver\null(),
$this->config,
$this->db,
$phpbb_root_path,

View File

@@ -53,7 +53,7 @@ class phpbb_notification_submit_post_base extends phpbb_database_test_case
$db = $this->db;
// Auth
$auth = $this->getMock('phpbb_auth');
$auth = $this->getMock('\phpbb\auth\auth');
$auth->expects($this->any())
->method('acl_get')
->with($this->stringContains('_'),
@@ -65,12 +65,12 @@ class phpbb_notification_submit_post_base extends phpbb_database_test_case
)));
// Config
$config = new phpbb_config(array('num_topics' => 1,'num_posts' => 1,));
$config = new \phpbb\config\config(array('num_topics' => 1,'num_posts' => 1,));
set_config(null, null, null, $config);
set_config_count(null, null, null, $config);
$cache = new phpbb_cache_service(
new phpbb_cache_driver_null(),
$cache = new \phpbb\cache\service(
new \phpbb\cache\driver\null(),
$config,
$db,
$phpbb_root_path,
@@ -81,7 +81,7 @@ class phpbb_notification_submit_post_base extends phpbb_database_test_case
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
// User
$user = $this->getMock('phpbb_user');
$user = $this->getMock('\phpbb\user');
$user->ip = '';
$user->data = array(
'user_id' => 2,
@@ -91,14 +91,14 @@ class phpbb_notification_submit_post_base extends phpbb_database_test_case
);
// Request
$type_cast_helper = $this->getMock('phpbb_request_type_cast_helper_interface');
$request = $this->getMock('phpbb_request');
$type_cast_helper = $this->getMock('\phpbb\request\type_cast_helper_interface');
$request = $this->getMock('\phpbb\request\request');
// Container
$phpbb_container = new phpbb_mock_container_builder();
$phpbb_container->set('content.visibility', new phpbb_content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE));
$phpbb_container->set('content.visibility', new \phpbb\content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE));
$user_loader = new phpbb_user_loader($db, $phpbb_root_path, $phpEx, USERS_TABLE);
$user_loader = new \phpbb\user_loader($db, $phpbb_root_path, $phpEx, USERS_TABLE);
// Notification Types
$notification_types = array('quote', 'bookmark', 'post', 'post_in_queue', 'topic', 'approve_topic', 'approve_post');
@@ -117,7 +117,7 @@ class phpbb_notification_submit_post_base extends phpbb_database_test_case
}
// Notification Manager
$phpbb_notifications = new phpbb_notification_manager($notification_types_array, array(),
$phpbb_notifications = new \phpbb\notification\manager($notification_types_array, array(),
$phpbb_container, $user_loader, $db, $cache, $user,
$phpbb_root_path, $phpEx,
NOTIFICATION_TYPES_TABLE, NOTIFICATIONS_TABLE, USER_NOTIFICATIONS_TABLE);

View File

@@ -16,7 +16,7 @@ class phpbb_deactivated_super_global_test extends phpbb_test_case
public function test_write_triggers_error()
{
$this->setExpectedTriggerError(E_USER_ERROR);
$obj = new phpbb_request_deactivated_super_global($this->getMock('phpbb_request_request_interface'), 'obj', phpbb_request_request_interface::POST);
$obj = new \phpbb\request\deactivated_super_global($this->getMock('\phpbb\request\request_interface'), 'obj', \phpbb\request\request_interface::POST);
$obj->offsetSet(0, 0);
}
}

View File

@@ -33,8 +33,8 @@ class phpbb_request_test extends phpbb_test_case
$_SERVER['HTTP_ACCEPT'] = 'application/json';
$_SERVER['HTTP_SOMEVAR'] = '<value>';
$this->type_cast_helper = $this->getMock('phpbb_request_type_cast_helper_interface');
$this->request = new phpbb_request($this->type_cast_helper);
$this->type_cast_helper = $this->getMock('\phpbb\request\type_cast_helper_interface');
$this->request = new \phpbb\request\request($this->type_cast_helper);
}
public function test_toggle_super_globals()
@@ -135,7 +135,7 @@ class phpbb_request_test extends phpbb_test_case
{
$this->request->enable_super_globals();
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest';
$this->request = new phpbb_request($this->type_cast_helper);
$this->request = new \phpbb\request\request($this->type_cast_helper);
$this->assertTrue($this->request->is_ajax());
}
@@ -146,7 +146,7 @@ class phpbb_request_test extends phpbb_test_case
$this->request->enable_super_globals();
$_SERVER['HTTPS'] = 'on';
$this->request = new phpbb_request($this->type_cast_helper);
$this->request = new \phpbb\request\request($this->type_cast_helper);
$this->assertTrue($this->request->is_secure());
}

View File

@@ -90,7 +90,7 @@ class phpbb_request_var_test extends phpbb_test_case
{
$this->unset_variables('var');
// cannot set $_REQUEST directly because in phpbb_request implementation
// cannot set $_REQUEST directly because in \phpbb\request\request implementation
// $_REQUEST = $_POST + $_GET
$_POST['var'] = array(
0 => array(

View File

@@ -16,7 +16,7 @@ class phpbb_type_cast_helper_test extends phpbb_test_case
protected function setUp()
{
$this->type_cast_helper = new phpbb_request_type_cast_helper();
$this->type_cast_helper = new \phpbb\request\type_cast_helper();
}
public function test_addslashes_recursively()

View File

@@ -34,7 +34,7 @@ class phpbb_search_mysql_test extends phpbb_search_common_test_case
$this->db = $this->new_dbal();
$error = null;
$class = self::get_search_wrapper('phpbb_search_fulltext_mysql');
$class = self::get_search_wrapper('\phpbb\search\fulltext_mysql');
$this->search = new $class($error, $phpbb_root_path, $phpEx, null, $config, $this->db, $user);
}
}

View File

@@ -30,7 +30,7 @@ class phpbb_search_native_test extends phpbb_search_test_case
$this->db = $this->new_dbal();
$error = null;
$class = self::get_search_wrapper('phpbb_search_fulltext_native');
$class = self::get_search_wrapper('\phpbb\search\fulltext_native');
$this->search = new $class($error, $phpbb_root_path, $phpEx, null, $config, $this->db, $user);
}

View File

@@ -34,7 +34,7 @@ class phpbb_search_postgres_test extends phpbb_search_common_test_case
$this->db = $this->new_dbal();
$error = null;
$class = self::get_search_wrapper('phpbb_search_fulltext_postgres');
$class = self::get_search_wrapper('\phpbb\search\fulltext_postgres');
$this->search = new $class($error, $phpbb_root_path, $phpEx, null, $config, $this->db, $user);
}
}

View File

@@ -39,13 +39,13 @@ abstract class phpbb_security_test_base extends phpbb_test_case
$request = new phpbb_mock_request(array(), array(), array(), $server);
// Set no user and trick a bit to circumvent errors
$user = new phpbb_user();
$user = new \phpbb\user();
$user->lang = true;
$user->browser = $server['HTTP_USER_AGENT'];
$user->referer = '';
$user->forwarded_for = '';
$user->host = $server['HTTP_HOST'];
$user->page = phpbb_session::extract_current_page($phpbb_root_path);
$user->page = \phpbb\session::extract_current_page($phpbb_root_path);
}
protected function tearDown()

View File

@@ -28,12 +28,12 @@ class phpbb_security_extract_current_page_test extends phpbb_security_test_base
{
global $request;
$request->merge(phpbb_request_request_interface::SERVER, array(
$request->merge(\phpbb\request\request_interface::SERVER, array(
'PHP_SELF' => $url,
'QUERY_STRING' => $query_string,
));
$result = phpbb_session::extract_current_page('./');
$result = \phpbb\session::extract_current_page('./');
$label = 'Running extract_current_page on ' . $query_string . ' with PHP_SELF filled.';
$this->assertEquals($expected, $result['query_string'], $label);
@@ -46,12 +46,12 @@ class phpbb_security_extract_current_page_test extends phpbb_security_test_base
{
global $request;
$request->merge(phpbb_request_request_interface::SERVER, array(
$request->merge(\phpbb\request\request_interface::SERVER, array(
'PHP_SELF' => $url,
'QUERY_STRING' => $query_string,
));
$result = phpbb_session::extract_current_page('./');
$result = \phpbb\session::extract_current_page('./');
$label = 'Running extract_current_page on ' . $query_string . ' with REQUEST_URI filled.';
$this->assertEquals($expected, $result['query_string'], $label);

View File

@@ -56,11 +56,11 @@ class phpbb_session_continue_test extends phpbb_database_test_case
global $phpbb_container, $phpbb_root_path, $phpEx;
$db = $this->new_dbal();
$config = new phpbb_config(array());
$request = $this->getMock('phpbb_request');
$user = $this->getMock('phpbb_user');
$config = new \phpbb\config\config(array());
$request = $this->getMock('\phpbb\request\request');
$user = $this->getMock('\phpbb\user');
$auth_provider = new phpbb_auth_provider_db($db, $config, $request, $user, $phpbb_root_path, $phpEx);
$auth_provider = new \phpbb\auth\provider\db($db, $config, $request, $user, $phpbb_root_path, $phpEx);
$phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
$phpbb_container->expects($this->any())
->method('get')

View File

@@ -23,11 +23,11 @@ class phpbb_session_creation_test extends phpbb_database_test_case
global $phpbb_container, $phpbb_root_path, $phpEx;
$db = $this->new_dbal();
$config = new phpbb_config(array());
$request = $this->getMock('phpbb_request');
$user = $this->getMock('phpbb_user');
$config = new \phpbb\config\config(array());
$request = $this->getMock('\phpbb\request\request');
$user = $this->getMock('\phpbb\user');
$auth_provider = new phpbb_auth_provider_db($db, $config, $request, $user, $phpbb_root_path, $phpEx);
$auth_provider = new \phpbb\auth\provider\db($db, $config, $request, $user, $phpbb_root_path, $phpEx);
$phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
$phpbb_container->expects($this->any())
->method('get')

View File

@@ -59,10 +59,10 @@ class phpbb_session_testable_factory
/**
* Retrieve the configured session class instance
*
* @param phpbb_db_driver $dbal The database connection to use for session data
* @param \phpbb\db\driver\driver $dbal The database connection to use for session data
* @return phpbb_mock_session_testable A session instance
*/
public function get_session(phpbb_db_driver $dbal)
public function get_session(\phpbb\db\driver\driver $dbal)
{
// set up all the global variables used by session
global $SID, $_SID, $db, $config, $cache, $request;
@@ -75,7 +75,7 @@ class phpbb_session_testable_factory
);
request_var(null, null, null, null, $request);
$config = $this->config = new phpbb_config($this->get_config_data());
$config = $this->config = new \phpbb\config\config($this->get_config_data());
set_config(null, null, null, $config);
$db = $dbal;

View File

@@ -100,16 +100,16 @@ Zeta test event in all',
global $phpbb_root_path, $phpEx, $user;
$defaults = $this->config_defaults();
$config = new phpbb_config(array_merge($defaults, $new_config));
$config = new \phpbb\config\config(array_merge($defaults, $new_config));
$this->template_path = dirname(__FILE__) . "/datasets/$dataset/styles/silver/template";
$this->style_resource_locator = new phpbb_style_resource_locator();
$this->style_resource_locator = new \phpbb\style\resource_locator();
$this->extension_manager = new phpbb_mock_filesystem_extension_manager(
dirname(__FILE__) . "/datasets/$dataset/"
);
$this->template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $user, new phpbb_template_context, $this->extension_manager);
$this->style_provider = new phpbb_style_path_provider();
$this->style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, $this->style_provider, $this->template);
$this->template = new \phpbb\template\twig\twig($phpbb_root_path, $phpEx, $config, $user, new \phpbb\template\context, $this->extension_manager);
$this->style_provider = new \phpbb\style\path_provider();
$this->style = new \phpbb\style\style($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, $this->style_provider, $this->template);
$this->style->set_custom_style('silver', array($this->template_path), $style_names, '');
}
}

Some files were not shown because too many files have changed in this diff Show More