diff options
author | asperous <asperous2@gmail.com> | 2013-07-12 11:08:16 -0700 |
---|---|---|
committer | Andy Chase <asperous2@gmail.com> | 2013-07-22 11:07:43 -0700 |
commit | 2d850ba7a8f57dd74a23f0feaedf5c5fc409a520 (patch) | |
tree | 4d448fe81ee4779c9173c65881481d75cdff862a | |
parent | e74abfaa2c25b7c9b4f2f865fbf6800de0761a6b (diff) | |
download | forums-2d850ba7a8f57dd74a23f0feaedf5c5fc409a520.tar forums-2d850ba7a8f57dd74a23f0feaedf5c5fc409a520.tar.gz forums-2d850ba7a8f57dd74a23f0feaedf5c5fc409a520.tar.bz2 forums-2d850ba7a8f57dd74a23f0feaedf5c5fc409a520.tar.xz forums-2d850ba7a8f57dd74a23f0feaedf5c5fc409a520.zip |
[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
-rw-r--r-- | tests/session/check_isvalid_test.php | 26 |
1 files 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; } |