Esempio n. 1
0
 /**
  * Tests that the expression is correctly traversed
  *
  * @return void
  */
 public function testTraverse()
 {
     $count = 0;
     $visitor = function () use(&$count) {
         $count++;
     };
     $expr = new QueryExpression();
     $expr->eq('test', 'true');
     $expr2 = new QueryExpression();
     $expr2->eq('test', 'false');
     $caseExpression = new CaseExpression([$expr, $expr2]);
     $caseExpression->traverse($visitor);
     $this->assertSame(4, $count);
 }