Author: Elliot Levin (elliotlevin@hotmail.com)
Inheritance: implements Pinq\Parsing\IFunctionInterpreter
 /**
  * @dataProvider expressions
  */
 public function testExpressionCompilation($phpCallable, $expectedSql)
 {
     // Parse the first statement from callable into an expression tree.
     $expression = FunctionInterpreter::getDefault()->getStructure(FunctionReflection::fromCallable($phpCallable))->getBodyExpressions()[0];
     $compiler = new ExpressionCompiler(new Select($this->pdo, new TableSourceInfo('table'), new ParameterCollection()));
     $this->assertSame($expectedSql, $compiler->compile($expression), 'PHP Code: ' . $expression->compile());
 }
 protected function buildFunctionInterpreter()
 {
     return Parsing\FunctionInterpreter::getDefault();
 }
Esempio n. 3
0
 protected function setUp()
 {
     $this->functionInterpreter = Parsing\FunctionInterpreter::getDefault();
 }
Esempio n. 4
0
 public function __construct(IFunctionInterpreter $functionInterpreter = null)
 {
     $this->functionInterpreter = $functionInterpreter ?: FunctionInterpreter::getDefault();
 }
 /**
  * @return IFunctionInterpreter
  */
 protected function functionInterpreter()
 {
     return FunctionInterpreter::getDefault();
 }
Esempio n. 6
0
 protected function setUp()
 {
     $this->interpreter = FunctionInterpreter::getDefault();
 }
Esempio n. 7
0
 protected function implementations()
 {
     return [Parsing\FunctionInterpreter::getDefault()];
 }