8000 [ExpressionLanguage] fix tests (bis) · symfony/symfony@e28d378 · GitHub
[go: up one dir, main page]

Skip to content

Commit e28d378

Browse files
[ExpressionLanguage] fix tests (bis)
1 parent 57a46e0 commit e28d378

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Symfony/Component/ExpressionLanguage/Tests/Node/BinaryNodeTest.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,23 +173,26 @@ public function testEvaluateMatchesWithInvalidRegexp()
173173
{
174174
$node = new BinaryNode('matches', new ConstantNode('abc'), new ConstantNode('this is not a regexp'));
175175

176-
$this->expectExceptionObject(new SyntaxError('Regexp "this is not a regexp" passed to "matches" is not valid: Delimiter must not be alphanumeric'));
176+
$this->expectException(SyntaxError::class);
177+
$this->expectExceptionMessage('Regexp "this is not a regexp" passed to "matches" is not valid: Delimiter must not be alphanumeric');
177178
$node->evaluate([], []);
178179
}
179180

180181
public function testEvaluateMatchesWithInvalidRegexpAsExpression()
181182
{
182183
$node = new BinaryNode('matches', new ConstantNode('abc'), new NameNode('regexp'));
183184

184-
$this->expectExceptionObject(new SyntaxError('Regexp "this is not a regexp" passed to "matches" is not valid: Delimiter must not be alphanumeric'));
185+
$this->expectException(SyntaxError::class);
186+
$this->expectExceptionMessage('Regexp "this is not a regexp" passed to "matches" is not valid: Delimiter must not be alphanumeric');
185187
$node->evaluate([], ['regexp' => 'this is not a regexp']);
186188
}
187189

188190
public function testCompileMatchesWithInvalidRegexp()
189191
{
190192
$node = new BinaryNode('matches', new ConstantNode('abc'), new ConstantNode('this is not a regexp'));
191193

192-
$this->expectExceptionObject(new SyntaxError('Regexp "this is not a regexp" passed to "matches" is not valid: Delimiter must not be alphanumeric'));
194+
$this->expectException(SyntaxError::class);
195+
$this->expectExceptionMessage('Regexp "this is not a regexp" passed to "matches" is not valid: Delimiter must not be alphanumeric');
193196
$compiler = new Compiler([]);
194197
$node->compile($compiler);
195198
}
@@ -198,7 +201,8 @@ public function testCompileMatchesWithInvalidRegexpAsExpression()
198201
{
199202
$node = new BinaryNode('matches', new ConstantNode('abc'), new NameNode('regexp'));
200203

201-
$this->expectExceptionObject(new SyntaxError('Regexp "this is not a regexp" passed to "matches" is not valid: Delimiter must not be alphanumeric'));
204+
$this->expectException(SyntaxError::class);
205+
$this->expectExceptionMessage('Regexp "this is not a regexp" passed to "matches" is not valid: Delimiter must not be alphanumeric');
202206
$compiler = new Compiler([]);
203207
$node->compile($compiler);
204208
eval('$regexp = "this is not a regexp"; '.$compiler->getSource().';');

0 commit comments

Comments
 (0)
0