Phalcon\Test\Unit\Mvc\UrlTest::testUrlForGet PHP Method

testUrlForGet() public method

Test should avoid double slash when joining baseUri to provided uri
Since: 2015-02-03
Author: Olivier Monaco ([email protected])
public testUrlForGet ( )
    public function testUrlForGet()
    {
        $this->specify("Url::get does not return expected value", function () {
            $url = new Url();
            $url->setBaseUri('http://www.test.com');
            expect($url->get(''))->equals('http://www.test.com');
            expect($url->get('/'))->equals('http://www.test.com/');
            expect($url->get('/path'))->equals('http://www.test.com/path');
            $url->setBaseUri('http://www.test.com/?_url=/');
            expect($url->get('path', ['params' => 'one']))->equals('http://www.test.com/?_url=/path&params=one');
        });
    }