mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-06 16:56:44 +02:00
[feature/request-class] Add is_secure method to request for HTTPS
PHPBB3-9716
This commit is contained in:
@@ -57,6 +57,11 @@ class phpbb_mock_request implements phpbb_request_interface
|
||||
return false;
|
||||
}
|
||||
|
||||
public function is_secure()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function variable_names($super_global = phpbb_request_interface::REQUEST)
|
||||
{
|
||||
return array_keys($this->data[$super_global]);
|
||||
|
@@ -117,6 +117,17 @@ class phpbb_request_test extends phpbb_test_case
|
||||
$this->assertTrue($this->request->is_ajax());
|
||||
}
|
||||
|
||||
public function test_is_secure()
|
||||
{
|
||||
$this->assertFalse($this->request->is_secure());
|
||||
|
||||
$this->request->enable_super_globals();
|
||||
$_SERVER['HTTPS'] = 'on';
|
||||
$this->request = new phpbb_request($this->type_cast_helper);
|
||||
|
||||
$this->assertTrue($this->request->is_secure());
|
||||
}
|
||||
|
||||
public function test_variable_names()
|
||||
{
|
||||
$expected = array('test', 'unset');
|
||||
|
Reference in New Issue
Block a user