mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-12 14:28:56 +00:00
[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
This commit is contained in:
parent
e74abfaa2c
commit
2d850ba7a8
1 changed files with 6 additions and 20 deletions
|
@ -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()
|
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)
|
protected function access_with($session_id, $user_id, $user_agent, $ip)
|
||||||
{
|
{
|
||||||
global $phpbb_container, $phpbb_root_path, $phpEx;
|
$this->session_factory->merge_test_data($session_id, $user_id, $user_agent, $ip);
|
||||||
|
|
||||||
$db = $this->new_dbal();
|
$session = $this->session_factory->get_session($this->db);
|
||||||
$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);
|
|
||||||
|
|
||||||
$session = $session_factory->get_session($db);
|
|
||||||
$session->page = array('page' => 'page', 'forum' => 0);
|
$session->page = array('page' => 'page', 'forum' => 0);
|
||||||
|
|
||||||
$session->session_begin();
|
$session->session_begin();
|
||||||
$session_factory->check($this);
|
$this->session_factory->check($this);
|
||||||
return $session;
|
return $session;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue