* @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:----LnJrd7//ULZbNg8Kz3AghQb3QbbkSsLEPRwLrM+Laht3y4iFhexezWWGaUN5Pjq5656SDTjBtWt1TuKN+Ge4hzxx8SuysSmOLe4pNE4CD7/8YBsEdnhcR/xFqNAWlrtwqA3DruBcZ3zYovGaZok5B0I7NuHTCXPLmHURLsa/xQdNZSJyfU72ksKq3A1o6HARqWGjpWBVD5jhA/WVwXmZ52QGyX02UGD7aLkHax9GkhsOm8tRD87qfB78N24N/B0hp5gP6TNAGrUSmLXIKgd0zWkKnPUlrZjOiLf1UXalG9VPVtTy4w3tgf949v3BJq29DwUn8F6HStKXp398/TNGdq0VpjeUC54OG90Z6roK3DB5BOyrGsWfI+gphSqfrLt/K/uSmfs78ZBCZ6WUa0bIPbGjCm//lYwGhagkLhwLnjjEbCdzIn1dyQZlhX01VxzGhWYexSkyBB4niiNsXqef29fSSE0tyb7Zkgg0YktqSl1/Z98eV02iovxu72dn9HdBhoEiyptiGK5yu2SOVUVC+veUA65QzSdu0fkRj2nSEaaKMcK24jnTTceUaFcTtdp5aKDQNL8/Zp8Dd+XKyf5hbjL+E4/Xs5d+Jft/3Gml177V7TUZi90OrH8c4qt+4QQO3CLGI8qKIttuVjzn1FlJJvtqbYT1vKsmgZDxMx2OJf4=----ATTACHMENT:----NzA5MTA2ODQxMjA4NDA5NyAzNDI0Njg4MzMwNDI4MzAgNzExNzQzOTQyNTk3MTE1Nw==