/** * @param string $operation * @param string $op1 * @param string $op2 * @param string $expected * @dataProvider basicCalcProvider */ public function testBasicCalc($operation, $op1, $op2, $expected) { $result = ''; switch ($operation) { case 'add': $result = $this->adapter->add($op1, $op2); break; case 'sub': $result = $this->adapter->sub($op1, $op2); break; case 'mul': $result = $this->adapter->mul($op1, $op2); break; case 'div': $result = $this->adapter->div($op1, $op2); break; case 'pow': $result = $this->adapter->pow($op1, $op2); break; case 'mod': $result = $this->adapter->mod($op1, $op2); break; } $this->assertEquals($expected, $result, "Operation [{$op1} {$operation} {$op2}] has failed"); }