Skip to content

Commit 41cf1cc

Browse files
committed
minor symfony#10223 [ExpressionLanguage] added some tests for the built-in constant() function (fabpot)
This PR was merged into the 2.4 branch. Discussion ---------- [ExpressionLanguage] added some tests for the built-in constant() function | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#10216 | License | MIT | Doc PR | n/a Commits ------- d8f55f5 [ExpressionLanguage] added some tests for the built-in constant() function
2 parents aca1686 + d8f55f5 commit 41cf1cc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,13 @@ public function testCachedParse()
4545
$parsedExpression = $expressionLanguage->parse('1 + 1', array());
4646
$this->assertSame($savedParsedExpression, $parsedExpression);
4747
}
48+
49+
public function testConstantFunction()
50+
{
51+
$expressionLanguage = new ExpressionLanguage();
52+
$this->assertEquals(PHP_VERSION, $expressionLanguage->evaluate('constant("PHP_VERSION")'));
53+
54+
$expressionLanguage = new ExpressionLanguage();
55+
$this->assertEquals('constant("PHP_VERSION")', $expressionLanguage->compile('constant("PHP_VERSION")'));
56+
}
4857
}

0 commit comments

Comments
 (0)