public function testName()
 {
     /** @var \Pharborist\Functions\FunctionCallNode $function_call */
     $function_call = Parser::parseExpression('test()');
     $this->assertEquals('test', $function_call->getName()->getText());
     $function_call->setName('hello');
     $this->assertEquals('hello', $function_call->getName()->getText());
 }
 /**
  * @dataProvider providerParseExpressionWithVariables
  */
 public function testParseExpressionWithVariables($expected, $value, $variables)
 {
     $this->parser->setVariables($variables);
     $result = $this->parser->parseExpression($value);
     $this->assertEquals($expected, $result);
 }
예제 #3
0
 /**
  * Test simple expressions
  */
 public function testParseSimpleExpression()
 {
     $oOutputQueue = Parser::parseExpression('1+1');
     $this->assertCount(3, $oOutputQueue->getItems());
 }