You are here

public function RequestTest::testGetSchemeAndHttpHost in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Tests/RequestTest.php \Symfony\Component\HttpFoundation\Tests\RequestTest::testGetSchemeAndHttpHost()

@covers Symfony\Component\HttpFoundation\Request::getSchemeAndHttpHost

File

vendor/symfony/http-foundation/Tests/RequestTest.php, line 636

Class

RequestTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testGetSchemeAndHttpHost() {
  $request = new Request();
  $server = array();
  $server['SERVER_NAME'] = 'servername';
  $server['SERVER_PORT'] = '90';
  $request
    ->initialize(array(), array(), array(), array(), array(), $server);
  $this
    ->assertEquals('http://servername:90', $request
    ->getSchemeAndHttpHost());
  $server['PHP_AUTH_USER'] = 'fabien';
  $request
    ->initialize(array(), array(), array(), array(), array(), $server);
  $this
    ->assertEquals('http://servername:90', $request
    ->getSchemeAndHttpHost());
  $server['PHP_AUTH_USER'] = '0';
  $request
    ->initialize(array(), array(), array(), array(), array(), $server);
  $this
    ->assertEquals('http://servername:90', $request
    ->getSchemeAndHttpHost());
  $server['PHP_AUTH_PW'] = '0';
  $request
    ->initialize(array(), array(), array(), array(), array(), $server);
  $this
    ->assertEquals('http://servername:90', $request
    ->getSchemeAndHttpHost());
}