eZ\Bundle\EzPublishRestBundle\Tests\CorsOptions\RestProviderTest::getRequestMatcherMock PHP Method

getRequestMatcherMock() protected method

protected getRequestMatcherMock ( ) : PHPUnit_Framework_MockObject_MockObjec\PHPUnit_Framework_MockObject_MockObject | Symfony\Component\Routing\Matcher\RequestMatcherInterface
return PHPUnit_Framework_MockObject_MockObjec\PHPUnit_Framework_MockObject_MockObject | Symfony\Component\Routing\Matcher\RequestMatcherInterface
    protected function getRequestMatcherMock()
    {
        $mock = $this->getMock('Symfony\\Component\\Routing\\Matcher\\RequestMatcherInterface');
        if ($this->matchRequestResult instanceof Exception) {
            $mock->expects($this->any())->method('matchRequest')->will($this->throwException($this->matchRequestResult));
        } elseif ($this->matchRequestResult === false) {
            $mock->expects($this->never())->method('matchRequest');
        } else {
            $mock->expects($this->any())->method('matchRequest')->will($this->returnValue($this->matchRequestResult));
        }
        return $mock;
    }