mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-11 05:48:51 +00:00
[ticket/11620] Reworked create_test without data provider
PHPBB3-11620
This commit is contained in:
parent
521d35dd6e
commit
6f8187f7fa
1 changed files with 11 additions and 42 deletions
|
@ -37,50 +37,19 @@ class phpbb_session_create_test extends phpbb_database_test_case
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
static function create_inputs() {
|
function test_bot_session ()
|
||||||
return array(
|
|
||||||
array(
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
false,
|
|
||||||
array(),
|
|
||||||
'user agent',
|
|
||||||
'127.0.0.1',
|
|
||||||
self::bot('user agent', 13, '127.0.0.1'),
|
|
||||||
'',
|
|
||||||
function ($test, $output) {
|
|
||||||
$test->assertEquals($output->data['is_bot'], true, "should be a bot");
|
|
||||||
}
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @dataProvider create_inputs */
|
|
||||||
function test_session_create (
|
|
||||||
$user_id = false,
|
|
||||||
$set_admin = false,
|
|
||||||
$persist_login = false,
|
|
||||||
$viewonline = true,
|
|
||||||
array $config_overrides = array(),
|
|
||||||
$user_agent = "",
|
|
||||||
$ip_address = "",
|
|
||||||
array $bot_overrides = array(),
|
|
||||||
$uri_sid = "",
|
|
||||||
$test_function
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
$output = $this->session_facade->session_create(
|
$output = $this->session_facade->session_create(
|
||||||
$user_id,
|
false,
|
||||||
$set_admin,
|
false,
|
||||||
$persist_login,
|
false,
|
||||||
$viewonline,
|
false,
|
||||||
$config_overrides,
|
array(),
|
||||||
$user_agent,
|
'user agent',
|
||||||
$ip_address,
|
'127.0.0.1',
|
||||||
$bot_overrides,
|
self::bot('user agent', 13, '127.0.0.1'),
|
||||||
$uri_sid
|
''
|
||||||
);
|
);
|
||||||
$test_function($this, $output);
|
$this->assertEquals($output->data['is_bot'], true, "should be a bot");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue