|
|
@@ -698,36 +698,27 @@ class RequestTest extends TestCase {
|
|
|
* @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'));
|
|
|
}
|
|
|
|