lithium\tests\cases\action\RequestTest::testConvertToUrl PHP Method

testConvertToUrl() public method

Tests that action\Request correctly inherits the functionality of the to() method inherited from lithium\net\http\Request.
public testConvertToUrl ( )
    public function testConvertToUrl()
    {
        $request = new Request(array('env' => array('HTTP_HOST' => 'foo.com', 'HTTPS' => 'on'), 'base' => '/the/base/path', 'url' => '/the/url', 'query' => array('some' => 'query', 'parameter' => 'values')));
        $expected = 'https://foo.com/the/base/path/the/url?some=query&parameter=values';
        $this->assertEqual($expected, $request->to('url'));
        $request = new Request(array('env' => array('HTTP_HOST' => 'foo.com'), 'base' => '/', 'url' => '/', 'query' => array()));
        $expected = 'http://foo.com/';
        $this->assertEqual($expected, $request->to('url'));
        $request = new Request(array('url' => 'foo/bar', 'base' => null, 'env' => array('HTTP_HOST' => 'example.com', 'PHP_SELF' => '/index.php')));
        $expected = 'http://example.com/foo/bar';
        $this->assertEqual($expected, $request->to('url'));
    }
RequestTest