/** * @dataProvider transformProvider */ public function testTransform(QuantityValue $quantity, $transformation, QuantityValue $expected) { $args = func_get_args(); $extraArgs = array_slice($args, 3); $call = array($quantity, 'transform'); $callArgs = array_merge(array('x', $transformation), $extraArgs); $actual = call_user_func_array($call, $callArgs); $this->assertEquals('x', $actual->getUnit()); $this->assertEquals($expected->getAmount()->getValue(), $actual->getAmount()->getValue(), 'value'); $this->assertEquals($expected->getUpperBound()->getValue(), $actual->getUpperBound()->getValue(), 'upper bound'); $this->assertEquals($expected->getLowerBound()->getValue(), $actual->getLowerBound()->getValue(), 'lower bound'); }