use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestMatcher\ExpressionRequestMatcher;
class ExpressionRequestMatcherTest extends TestCase
{ /**
* @dataProvider provideExpressions
*/
public function testMatchesWhenParentMatchesIsTrue($expression,
$expected) { $request = Request::
create('/foo'
);
$expressionRequestMatcher =
new ExpressionRequestMatcher(new ExpressionLanguage(),
$expression);
$this->
assertSame($expected,
$expressionRequestMatcher->
matches($request));
} public static function provideExpressions() { return [ ['request.getMethod() == method', true
],
['request.getPathInfo() == path', true
],
['request.getHost() == host', true
],
['request.getClientIp() == ip', true
],
['request.attributes.all() == attributes', true
],
[