getMock('\pjdietz\WellRESTed\Interfaces\RequestInterface'); $mockRequest->expects($this->any()) ->method('getPath') ->will($this->returnValue($path)); $path = "/"; $route = new StaticRoute($path, __NAMESPACE__ . '\NotAHandler'); $resp = $route->getResponse($mockRequest); } } class NotAHandler { }