* @license http://www.apache.org/licenses/LICENSE-2.0 * @link http://phpsx.org */ class PathMatchTest extends FilterTestCase { public function testPath() { $request = new Request(new Url('http://localhost/foobar'), 'GET'); $response = new Response(); $response->setBody(new StringStream()); $filter = $this->getMockBuilder(FilterInterface::class) ->setMethods(array('handle')) ->getMock(); $filter->expects($this->once()) ->method('handle') ->with($this->equalTo($request), $this->equalTo($response)); $handle = new PathMatch('/foo+', $filter); $handle->handle($request, $response, $this->getFilterChain(false)); } public function testWrongPath() { $request = new Request(new Url('http://localhost/baz'), 'GET'); $response = new Response(); $response->setBody(new StringStream()); $filter = $this->getMockBuilder(FilterInterface::class) ->setMethods(array('handle')) ->getMock(); $filter->expects($this->never()) ->method('handle') ->with($this->equalTo($request), $this->equalTo($response)); $handle = new PathMatch('/foo+', $filter); $handle->handle($request, $response, $this->getFilterChain(true, $request, $response)); } } __halt_compiler();----SIGNATURE:----KP5Aq5R6lkj4WYybN32tJwgKjuPmOPxZhYi3nNBHD2sDqS3orQHsaf6NAqWQuIPNJuzip3FQByPMrGKpZErm1G/FPbXpsDp9GiZuQ7AuYlNNqNGWu1BV8j9NBfkm9X/uGjJvng2XbiTuCQKF1qhHckS+4b7oaMtbMQvxh5rMLTwrof2JAoHL4ILCaKv7hVCSS2BSmD7IebtRXTNinengb9D+OK+gPL9zLz2tGRA0D8zEFYJcxrSNKw/uP7b6WTULuRL89rngqQ5Y4id/muwTBjFA0oIQ3CoOjjrdQL+aZ3TeRqRAW5PbSqfCuEgZmzJO9JrQ5MIY9hQpZA1UwRqdcxO9XkGaA9gaeAbEhJRmxWInammETQ6FMCV0wROnkJzb1zSjTLhr/gHwNETxVWAdOPYknx2z9MOpEWGLnHl6nVqXa7+Y0gXAuKvAKjKREpbS8UKAxwmf3jA6MDM2IXSxfeFmYTOG8HiTj1R81h236UrXEoW0YHQqCqLDtYmO1Z7C/FEMDOGLCS+6QYRNhYIKHf4+ZpUXXZ/0+TsFOZU7dq+vQjFrUlcyDy9llvqPaX8Oo/wAzkRXNXgH0L+xQA7fmb7qLQX6nRKpRlzOYBNuSoygfptO2uyRbilpRgWQYZkqTOP7X1cC5iftsPU6D585ZW/EobvdDGIMfhs3ev/OAXw=----ATTACHMENT:----NjQzNTY0NTY4MTQ5Njg5NiA4MzgwMDUwMTE4MTI0NjU1IDM0NTI5MTEzMjU2NzIxMjY=