예제 #1
0
 function testGenerateCicleForPropertyExpression()
 {
     $code_writer = new WactCodeWriter();
     $property = new WactCompilerPropertyDBETestVersion();
     $context = new WactCompileTreeNode();
     $context->registerProperty('Test', $property);
     $DBE = new WactDataBindingExpressionNode('Test', $context);
     $DBE->generatePreStatement($code_writer);
     $DBE->generateExpression($code_writer);
     $DBE->generatePostStatement($code_writer);
     $this->assertEqual($code_writer->getCode(), '<?php generatePreStatementOutput' . 'generateExpressionOutput' . 'generatePostStatementOutput');
 }
예제 #2
0
 function testGetValueForDBE()
 {
     $context = new WactCompileTreeNode();
     $property = new WactConstantProperty('hello');
     $context->registerProperty('Test', $property);
     $expression = new WactExpression('Test', $context, $this->filter_dictionary);
     $this->assertEqual($expression->getValue(), 'hello');
 }