AdamStipak\RestRouteTest::testMatchAndConstructUrl PHP Method

testMatchAndConstructUrl() public method

    public function testMatchAndConstructUrl()
    {
        $route = new RestRoute();
        $url = new UrlScript('http://localhost');
        $url->setPath('/resource');
        $url->setQuery(['access_token' => 'foo-bar']);
        $request = new Request($url, NULL, NULL, NULL, NULL, NULL, 'GET');
        $appRequest = $route->match($request);
        $refUrl = new Url('http://localhost');
        $url = $route->constructUrl($appRequest, $refUrl);
        $expectedUrl = 'http://localhost/resource?access_token=foo-bar';
        $this->assertEquals($expectedUrl, $url);
    }