/** * @test roundModes * @dataProvider roundValues * * @param int $mode * @param string $value * @param int $scale * @param string $result */ public function roundModes($mode, $value, $scale, $result) { $decimal = new BigDecimal($value); $rounded = $decimal->round($scale, $mode); $this->assertSame($result, $rounded->value(), sprintf('Round "%s" with mode "%d" and scale "%d"', $value, $mode, $scale)); }