eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\URIText::reverseMatch PHP Method

reverseMatch() public method

public reverseMatch ( $siteAccessName )
    public function reverseMatch($siteAccessName)
    {
        $this->request->setPathinfo("/{$this->prefix}{$siteAccessName}{$this->suffix}{$this->request->pathinfo}");
        return $this;
    }

Usage Example

 public function testReverseMatch()
 {
     $semanticURI = '/hihi/hoho';
     $matcher = new URITextMatcher(array('prefix' => 'foo', 'suffix' => 'bar'));
     $matcher->setRequest(new SimplifiedRequest(array('pathinfo' => $semanticURI)));
     $result = $matcher->reverseMatch('something');
     $this->assertInstanceOf('eZ\\Publish\\Core\\MVC\\Symfony\\SiteAccess\\Matcher\\URIText', $result);
     $request = $result->getRequest();
     $this->assertInstanceOf('eZ\\Publish\\Core\\MVC\\Symfony\\Routing\\SimplifiedRequest', $request);
     $this->assertSame("/foosomethingbar{$semanticURI}", $request->pathinfo);
 }