diff options
Diffstat (limited to 'tests/session')
| -rw-r--r-- | tests/session/append_sid_test.php | 2 | ||||
| -rw-r--r-- | tests/session/check_ban_test.php | 5 | ||||
| -rw-r--r-- | tests/session/extract_page_test.php | 3 | ||||
| -rw-r--r-- | tests/session/garbage_collection_test.php | 1 | ||||
| -rw-r--r-- | tests/session/session_key_test.php | 1 | ||||
| -rw-r--r-- | tests/session/testable_factory.php | 6 | 
6 files changed, 8 insertions, 10 deletions
| diff --git a/tests/session/append_sid_test.php b/tests/session/append_sid_test.php index 2a1d94514f..4e5a238644 100644 --- a/tests/session/append_sid_test.php +++ b/tests/session/append_sid_test.php @@ -11,8 +11,6 @@  *  */ -require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php'; -  class phpbb_session_append_sid_test extends phpbb_test_case  { diff --git a/tests/session/check_ban_test.php b/tests/session/check_ban_test.php index 561b7faf49..04da5f08b9 100644 --- a/tests/session/check_ban_test.php +++ b/tests/session/check_ban_test.php @@ -42,7 +42,10 @@ class phpbb_session_check_ban_test extends phpbb_session_test_case  		parent::setUp();  		// Get session here so that config is mocked correctly  		$this->session = $this->session_factory->get_session($this->db); -		global $cache, $config, $phpbb_root_path, $phpEx; +		global $cache, $config, $phpbb_root_path, $phpEx, $phpbb_filesystem; + +		$phpbb_filesystem = new \phpbb\filesystem\filesystem(); +  		$this->backup_cache = $cache;  		// Change the global cache object for this test because  		// the mock cache object does not hit the database as is needed diff --git a/tests/session/extract_page_test.php b/tests/session/extract_page_test.php index f0d1cdb60e..88eb7b2c1a 100644 --- a/tests/session/extract_page_test.php +++ b/tests/session/extract_page_test.php @@ -12,7 +12,6 @@  */  require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php'; -require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';  class phpbb_session_extract_page_test extends phpbb_session_test_case  { @@ -145,7 +144,7 @@ class phpbb_session_extract_page_test extends phpbb_session_test_case  	{  		global $symfony_request, $request, $phpbb_filesystem; -		$phpbb_filesystem = new \phpbb\filesystem(); +		$phpbb_filesystem = new \phpbb\filesystem\filesystem();  		$server['HTTP_HOST']			= 'localhost';  		$server['SERVER_NAME']			= 'localhost'; diff --git a/tests/session/garbage_collection_test.php b/tests/session/garbage_collection_test.php index 3fad81c68b..3dc591a328 100644 --- a/tests/session/garbage_collection_test.php +++ b/tests/session/garbage_collection_test.php @@ -12,7 +12,6 @@  */  require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php'; -require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';  class phpbb_session_garbage_collection_test extends phpbb_session_test_case  { diff --git a/tests/session/session_key_test.php b/tests/session/session_key_test.php index bf3dfcaa3c..2499ea1d55 100644 --- a/tests/session/session_key_test.php +++ b/tests/session/session_key_test.php @@ -11,7 +11,6 @@  *  */ -require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';  require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php';  class phpbb_session_login_keys_test extends phpbb_session_test_case diff --git a/tests/session/testable_factory.php b/tests/session/testable_factory.php index 3e25286480..6f8b49122b 100644 --- a/tests/session/testable_factory.php +++ b/tests/session/testable_factory.php @@ -73,7 +73,7 @@ class phpbb_session_testable_factory  	public function get_session(\phpbb\db\driver\driver_interface $dbal)  	{  		// set up all the global variables used by session -		global $SID, $_SID, $db, $config, $cache, $request, $phpbb_container; +		global $SID, $_SID, $db, $config, $cache, $request, $phpbb_container, $phpbb_root_path;  		$request = $this->request = new phpbb_mock_request(  			array(), @@ -81,10 +81,8 @@ class phpbb_session_testable_factory  			$this->cookies,  			$this->server_data  		); -		request_var(null, null, null, null, $request);  		$config = $this->config = new \phpbb\config\config($this->get_config_data()); -		set_config(null, null, null, $config);  		$db = $dbal; @@ -96,6 +94,8 @@ class phpbb_session_testable_factory  			'auth.provider.db',  			new phpbb_mock_auth_provider()  		); +		$phpbb_container->setParameter('core.environment', PHPBB_ENVIRONMENT); +		$phpbb_container->setParameter('core.cache_dir', $phpbb_root_path . 'cache/' . PHPBB_ENVIRONMENT . '/');  		$provider_collection = new \phpbb\auth\provider_collection($phpbb_container, $config);  		$provider_collection->add('auth.provider.db');  		$phpbb_container->set( | 
