Skip to content

Commit

Permalink
fixed tests, php < 7.3 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
MartkCz committed Jun 7, 2020
1 parent 309a8f2 commit a8b6d5b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/unit/ItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ protected function _before()
// tests
public function testTotalPriceWithoutTax()
{
$this->assertSame('30.00', $this->item->getTotalPrice($this->calculator, false));
// php bug < 7.3.0, bcmul ignores scale, https://bugs.php.net/bug.php?id=66364
$expected = PHP_VERSION_ID < 70300 ? '30' : '30.00';

$this->assertSame($expected, $this->item->getTotalPrice($this->calculator, false));
}

public function testTotalPriceSetFixed()
Expand All @@ -39,4 +42,4 @@ public function testTotalPriceSetFixedWithUseTax()
$this->assertSame('40.99', $this->item->getTotalPrice($this->calculator, true));
}

}
}

0 comments on commit a8b6d5b

Please sign in to comment.