Skip to content

Commit 42ae1d1

Browse files
committed
minor symfony#58462 [ExpressionLanguage] Add missing test case for Lexer (alexandre-daubois)
This PR was merged into the 5.4 branch. Discussion ---------- [ExpressionLanguage] Add missing test case for `Lexer` | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT Adds a missing test case for `Lexer`. Unclosed brackets are already tested, but not closing bracket without abnormal opening one. Commits ------- 4eb9157 [ExpressionLanguage] Add missing test case for `Lexer`
2 parents 2d324e5 + 4eb9157 commit 42ae1d1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Symfony/Component/ExpressionLanguage/Tests/LexerTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ public function testTokenizeThrowsErrorOnUnclosedBrace()
5454
$this->lexer->tokenize($expression);
5555
}
5656

57+
public function testTokenizeOnNotOpenedBracket()
58+
{
59+
$this->expectException(SyntaxError::class);
60+
$this->expectExceptionMessage('Unexpected ")" around position 7 for expression `service)not.opened.expression.dummyMethod()`.');
61+
62+
$expression = 'service)not.opened.expression.dummyMethod()';
63+
64+
$this->lexer->tokenize($expression);
65+
}
66+
5767
public static function getTokenizeData()
5868
{
5969
return [

0 commit comments

Comments
 (0)