/**
  * @dataProvider getCompileAndRunData
  */
 public function testCompileAndRun($expression, $result, $variables = array())
 {
     $compiler = new Compiler();
     $executable = $compiler->compile($expression);
     $this->assertEquals($executable->run($variables), $result);
 }
 private function logic($formula, $variables)
 {
     //dd($variables);
     $compiler = new Compiler();
     //dd($formula);
     try {
         $executable = $compiler->compile($formula);
         $result = $executable->run($variables);
     } catch (ParserException $e) {
         throw new GeneralException('Logical check formula error!');
     }
     return $result;
 }