[ticket/11620] Reworked create_test without data provider

PHPBB3-11620
This commit is contained in:
Andy Chase 2013-07-05 13:49:03 -07:00
parent 521d35dd6e
commit 6f8187f7fa

View file

@ -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");
} }
} }