Skip to content

Commit 45b08cb

Browse files
Merge branch '4.4' into 5.4
* 4.4: [PropertyInfo] CS fix [Serializer] Try all possible denormalization route with union types when ALLOW_EXTRA_ATTRIBUTES=false CS fix [Cache] Respect $save option in ChainAdapter [ExpressionLanguage] fix tests (bis) [ExpressionLanguage] fix tests [Cache] Respect $save option in ArrayAdapter [HttpKernel] Disable session tracking while collecting profiler data [MonologBridge] Fixed support of elasticsearch 7.+ in ElasticsearchLogstashHandler [DoctrineBridge] Extend type guessing on enum fields Fix for missing sender name in case with usage of the EnvelopeListener
2 parents 9d186e1 + a6c4a31 commit 45b08cb

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

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 or backslash'));
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 or backslash'));
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 or backslash'));
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 or backslash'));
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)