public function testShouldBeAbleToDivide() { $pushvalue = 12; $pushvalue2 = 2; $stack = new OperandStack(); $stack->push($pushvalue); $stack->push($pushvalue2); $op = new Divide(); $op->execute($stack); $this->assertEquals(6, $stack->peek()); }
public function testCanMultiplyTwoNumbers() { $pushvalue = 3; $pushvalue2 = 7; $stack = new OperandStack(); $stack->push($pushvalue); $stack->push($pushvalue2); $op = new Multiply(); $op->execute($stack); $this->assertEquals(21, $stack->peek()); }