Ergo\Tests\Http\RequestTest::testRequestFactoryWithAbsoluteUrlInEnvironment PHP Метод

testRequestFactoryWithAbsoluteUrlInEnvironment() публичный Метод

    public function testRequestFactoryWithAbsoluteUrlInEnvironment()
    {
        $server = array('SERVER_NAME' => 'example.com', 'HTTP_HOST' => 'example.com', 'SERVER_PORT' => '80', 'REQUEST_URI' => 'http://example.org/', 'REQUEST_METHOD' => 'GET');
        $factory = new Http\RequestFactory($server);
        $request = $factory->create();
        // I'm not sure exactly what the URL should be, but
        // there's currently a bug which is definitely less correct
        // than a URL that matches this pattern...
        $this->assertRegExp('#https?://example.com(:80)?/#', $request->getUrl()->__toString(), 'url: %s');
    }