Skip to content

Commit

Permalink
[ExpressionLanguage] added some tests for the built-in constant() fun…
Browse files Browse the repository at this point in the history
…ction
  • Loading branch information
fabpot committed Feb 10, 2014
1 parent aca1686 commit d8f55f5
Showing 1 changed file with 9 additions and 0 deletions.
Expand Up @@ -45,4 +45,13 @@ public function testCachedParse()
$parsedExpression = $expressionLanguage->parse('1 + 1', array());
$this->assertSame($savedParsedExpression, $parsedExpression);
}

public function testConstantFunction()
{
$expressionLanguage = new ExpressionLanguage();
$this->assertEquals(PHP_VERSION, $expressionLanguage->evaluate('constant("PHP_VERSION")'));

$expressionLanguage = new ExpressionLanguage();
$this->assertEquals('constant("PHP_VERSION")', $expressionLanguage->compile('constant("PHP_VERSION")'));
}
}

0 comments on commit d8f55f5

Please sign in to comment.