isSecure() public méthode

Indicates if this request has been received through a secure channel.
public isSecure ( ) : boolean
Résultat boolean
Exemple #1
0
 /**
  * @test
  */
 public function constructRecognizesSslSessionIdAsIndicatorForSsl()
 {
     $get = ['getKey1' => 'getValue1', 'getKey2' => 'getValue2'];
     $post = [];
     $files = [];
     $server = ['HTTP_HOST' => 'dev.blog.rob', 'SERVER_NAME' => 'dev.blog.rob', 'SERVER_ADDR' => '127.0.0.1', 'REMOTE_ADDR' => '127.0.0.1', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'REQUEST_METHOD' => 'GET', 'QUERY_STRING' => 'foo=bar', 'REQUEST_URI' => '/posts/2011/11/28/laboriosam-soluta-est-minus-molestiae?getKey1=getValue1&getKey2=getValue2', 'SCRIPT_NAME' => '/index.php', 'PHP_SELF' => '/index.php', 'SSL_SESSION_ID' => '12345'];
     $request = new Request($get, $post, $files, $server);
     $this->assertEquals('https', $request->getUri()->getScheme());
     $this->assertTrue($request->isSecure());
 }