From 2d850ba7a8f57dd74a23f0feaedf5c5fc409a520 Mon Sep 17 00:00:00 2001 From: asperous Date: Fri, 12 Jul 2013 11:08:16 -0700 Subject: [ticket/11620] Refactored check_isvalid_test to use session_test_case Since the continue->isvalid refactoring is now in a branch with the session_test_case framework, this test can be refactored to use that framework. PHPBB3-11620 --- tests/session/check_isvalid_test.php | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/tests/session/check_isvalid_test.php b/tests/session/check_isvalid_test.php index 8083e3406a..6c21359c7d 100644 --- a/tests/session/check_isvalid_test.php +++ b/tests/session/check_isvalid_test.php @@ -7,9 +7,10 @@ * */ -require_once dirname(__FILE__) . '/testable_factory.php'; +require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php'; -class phpbb_session_check_isvalid_test extends phpbb_database_test_case + +class phpbb_session_check_isvalid_test extends phpbb_session_test_case { public function getDataSet() { @@ -18,28 +19,13 @@ class phpbb_session_check_isvalid_test extends phpbb_database_test_case protected function access_with($session_id, $user_id, $user_agent, $ip) { - 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'); - - $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') - ->with('auth.provider.db') - ->will($this->returnValue($auth_provider)); - - $session_factory = new phpbb_session_testable_factory; - $session_factory->merge_test_data($session_id, $user_id, $user_agent, $ip); + $this->session_factory->merge_test_data($session_id, $user_id, $user_agent, $ip); - $session = $session_factory->get_session($db); + $session = $this->session_factory->get_session($this->db); $session->page = array('page' => 'page', 'forum' => 0); $session->session_begin(); - $session_factory->check($this); + $this->session_factory->check($this); return $session; } -- cgit v1.2.1