You are here

public function RequestTest::testGetBasePath 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::testGetBasePath()

File

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

Class

RequestTest

Namespace

Symfony\Component\HttpFoundation\Tests

Code

public function testGetBasePath() {
  $request = new Request();
  $this
    ->assertEquals('', $request
    ->getBasePath());
  $server = array();
  $server['SCRIPT_FILENAME'] = '/some/where/index.php';
  $request
    ->initialize(array(), array(), array(), array(), array(), $server);
  $this
    ->assertEquals('', $request
    ->getBasePath());
  $server = array();
  $server['SCRIPT_FILENAME'] = '/some/where/index.php';
  $server['SCRIPT_NAME'] = '/index.php';
  $request
    ->initialize(array(), array(), array(), array(), array(), $server);
  $this
    ->assertEquals('', $request
    ->getBasePath());
  $server = array();
  $server['SCRIPT_FILENAME'] = '/some/where/index.php';
  $server['PHP_SELF'] = '/index.php';
  $request
    ->initialize(array(), array(), array(), array(), array(), $server);
  $this
    ->assertEquals('', $request
    ->getBasePath());
  $server = array();
  $server['SCRIPT_FILENAME'] = '/some/where/index.php';
  $server['ORIG_SCRIPT_NAME'] = '/index.php';
  $request
    ->initialize(array(), array(), array(), array(), array(), $server);
  $this
    ->assertEquals('', $request
    ->getBasePath());
}