Skip to content

Commit d8f55f5

Browse files
committed
[ExpressionLanguage] added some tests for the built-in constant() function
1 parent aca1686 commit d8f55f5

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)