Skip to content

Commit 909368a

Browse files
Merge branch '6.0' into 6.1
* 6.0: Exclude from baseline generation deprecations triggered in legacy test [HttpFoundation] Update "[Session] Overwrite invalid session id" to only validate when files session storage is used [DoctrineBridge] Add missing break [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 Allow passing null in twig_is_selected_choice [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 [FrameworkBundle] Lower JsonSerializableNormalizer priority [Messenger] move resetting services at worker stopped into ResetServicesListener [Mailer] Fix Error Handling for OhMySMTP Bridge Fix for missing sender name in case with usage of the EnvelopeListener
2 parents be8d130 + add8780 commit 909368a

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
@@ -180,23 +180,26 @@ public function testEvaluateMatchesWithInvalidRegexp()
180180
{
181181
$node = new BinaryNode('matches', new ConstantNode('abc'), new ConstantNode('this is not a regexp'));
182182

183-
$this->expectExceptionObject(new SyntaxError('Regexp "this is not a regexp" passed to "matches" is not valid: Delimiter must not be alphanumeric or backslash'));
183+
$this->expectException(SyntaxError::class);
184+
$this->expectExceptionMessage('Regexp "this is not a regexp" passed to "matches" is not valid: Delimiter must not be alphanumeric');
184185
$node->evaluate([], []);
185186
}
186187

187188
public function testEvaluateMatchesWithInvalidRegexpAsExpression()
188189
{
189190
$node = new BinaryNode('matches', new ConstantNode('abc'), new NameNode('regexp'));
190191

191-
$this->expectExceptionObject(new SyntaxError('Regexp "this is not a regexp" passed to "matches" is not valid: Delimiter must not be alphanumeric or backslash'));
192+
$this->expectException(SyntaxError::class);
193+
$this->expectExceptionMessage('Regexp "this is not a regexp" passed to "matches" is not valid: Delimiter must not be alphanumeric');
192194
$node->evaluate([], ['regexp' => 'this is not a regexp']);
193195
}
194196

195197
public function testCompileMatchesWithInvalidRegexp()
196198
{
197199
$node = new BinaryNode('matches', new ConstantNode('abc'), new ConstantNode('this is not a regexp'));
198200

199-
$this->expectExceptionObject(new SyntaxError('Regexp "this is not a regexp" passed to "matches" is not valid: Delimiter must not be alphanumeric or backslash'));
201+
$this->expectException(SyntaxError::class);
202+
$this->expectExceptionMessage('Regexp "this is not a regexp" passed to "matches" is not valid: Delimiter must not be alphanumeric');
200203
$compiler = new Compiler([]);
201204
$node->compile($compiler);
202205
}
@@ -205,7 +208,8 @@ public function testCompileMatchesWithInvalidRegexpAsExpression()
205208
{
206209
$node = new BinaryNode('matches', new ConstantNode('abc'), new NameNode('regexp'));
207210

208-
$this->expectExceptionObject(new SyntaxError('Regexp "this is not a regexp" passed to "matches" is not valid: Delimiter must not be alphanumeric or backslash'));
211+
$this->expectException(SyntaxError::class);
212+
$this->expectExceptionMessage('Regexp "this is not a regexp" passed to "matches" is not valid: Delimiter must not be alphanumeric');
209213
$compiler = new Compiler([]);
210214
$node->compile($compiler);
211215
eval('$regexp = "this is not a regexp"; '.$compiler->getSource().';');

0 commit comments

Comments
 (0)