Beispiel #1
0
 public function test_simple_addition()
 {
     $m = new Math(new SimpleAdditionTokenizer(), new Dictionary());
     $this->assertSame(intval(2), $m->expression('foobar'));
 }
Beispiel #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);
 }