Skip to content
Permalink
Browse files

Update test to use request->env() instead of modifying globals.

  • Loading branch information...
ADmad committed Sep 4, 2014
1 parent 610f3a0 commit 39aaadfb641ab8d77097c5589429dce72cf1e6cf
Showing with 8 additions and 17 deletions.
  1. +8 −17 tests/TestCase/Network/RequestTest.php
@@ -698,36 +698,27 @@ public function testMagicCallExceptionOnUnknownMethod() {
* @return void
*/
public function testIsSsl() {
$_SERVER['HTTPS'] = 1;
$request = new Request();
$this->assertTrue($request->is('ssl'));
$_SERVER['HTTPS'] = 'on';
$request = new Request();
$request->env('HTTPS', 1);
$this->assertTrue($request->is('ssl'));
$_SERVER['HTTPS'] = '1';
$request = new Request();
$request->env('HTTPS', 'on');
$this->assertTrue($request->is('ssl'));
$_SERVER['HTTPS'] = 'I am not empty';
$request = new Request();
$request->env('HTTPS', '1');
$this->assertTrue($request->is('ssl'));
$_SERVER['HTTPS'] = 1;
$request = new Request();
$this->assertTrue($request->is('ssl'));
$request->env('HTTPS', 'I am not empty');
$this->assertFalse($request->is('ssl'));
$_SERVER['HTTPS'] = 'off';
$request = new Request();
$request->env('HTTPS', 'off');
$this->assertFalse($request->is('ssl'));
$_SERVER['HTTPS'] = false;
$request = new Request();
$request->env('HTTPS', false);
$this->assertFalse($request->is('ssl'));
$_SERVER['HTTPS'] = '';
$request = new Request();
$request->env('HTTPS', '');
$this->assertFalse($request->is('ssl'));
}

0 comments on commit 39aaadf

Please sign in to comment.
You can’t perform that action at this time.