Example #1
0
 /**
  * Add when expression
  *
  * @param string|ExpressionInterface $expression
  * @param string|ExpressionInterface $thenExpression
  *
  * @return $this
  */
 public function when($expression, $thenExpression)
 {
     $this->whenThenExpressions[] = ['WHEN' => $expression, 'THEN' => $thenExpression];
     if ($expression instanceof ExpressionInterface) {
         $this->pushParams($expression->getParams());
     }
     if ($thenExpression instanceof ExpressionInterface) {
         $this->pushParams($thenExpression->getParams());
     }
     return $this;
 }
Example #2
0
 public function assertExpr($compiled, ExpressionInterface $expr)
 {
     $this->assertSame($compiled, $expr->compile(Mock::getMysqliDriver($this)));
 }