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