Neos\Flow\Tests\Unit\Mvc\Routing\RouteTest::matchesThrowsExceptionIfRoutePartValueContainsObjects PHP Method

matchesThrowsExceptionIfRoutePartValueContainsObjects() public method

public matchesThrowsExceptionIfRoutePartValueContainsObjects ( boolean $shouldThrowException, mixed $routePartValue )
$shouldThrowException boolean
$routePartValue mixed
    public function matchesThrowsExceptionIfRoutePartValueContainsObjects($shouldThrowException, $routePartValue)
    {
        if ($shouldThrowException === true) {
            $this->setExpectedException(InvalidRoutePartValueException::class);
        }
        $mockRoutePart = $this->createMock(Routing\RoutePartInterface::class);
        $mockRoutePart->expects($this->once())->method('match')->with('foo')->will($this->returnValue(true));
        $mockRoutePart->expects($this->any())->method('getName')->will($this->returnValue('TestRoutePart'));
        $mockRoutePart->expects($this->once())->method('getValue')->will($this->returnValue($routePartValue));
        $this->route->setUriPattern('foo');
        $this->route->_set('routeParts', [$mockRoutePart]);
        $this->route->_set('isParsed', true);
        $this->routeMatchesPath('foo');
    }
RouteTest