aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/mock/request.php5
-rw-r--r--tests/request/request_test.php11
2 files changed, 16 insertions, 0 deletions
diff --git a/tests/mock/request.php b/tests/mock/request.php
index 86b8695e32..18aa2e724c 100644
--- a/tests/mock/request.php
+++ b/tests/mock/request.php
@@ -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]);
diff --git a/tests/request/request_test.php b/tests/request/request_test.php
index 24c9ae5112..2e56841601 100644
--- a/tests/request/request_test.php
+++ b/tests/request/request_test.php
@@ -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');