Exemplo n.º 1
0
 public function test_simple_addition()
 {
     $m = new Math(new SimpleAdditionTokenizer(), new Dictionary());
     $this->assertSame(intval(2), $m->expression('foobar'));
 }
Exemplo n.º 2
0
 /**
  * @test
  * @dataProvider provideParenthesisMismatch
  */
 public function parenthesis_mismatch($expr)
 {
     $m = new Math(new SimpleTokenizer(), new Shuntingyard(), new PostfixCalculator());
     $this->setExpectedException('Calculator\\Tokenizing\\ParenthesisMismatch');
     $m->expression($expr);
 }