public analyseURI ( string $uri ) : string | ||
$uri | string | The original URI |
return | string | The modified URI |
public function analyseURI($uri)
{
$uriElements = '/' . implode('/', $this->getURIElements());
if ($uri == $uriElements) {
$uri = '';
} elseif (strpos($uri, $uriElements) === 0) {
$uri = mb_substr($uri, mb_strlen($uriElements));
}
return $uri;
}
/** * @param string $uri * @param string $expectedFixedUpURI * * @dataProvider analyseProvider */ public function testAnalyseURI($uri, $expectedFixedUpURI) { $matcher = new URIElementMatcher(1); $matcher->setRequest(new SimplifiedRequest(array('pathinfo' => $uri))); $this->assertSame($expectedFixedUpURI, $matcher->analyseURI($uri)); }