This repository has been archived by the owner on Dec 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Andreu Correa
committed
Apr 30, 2017
1 parent
21a74f5
commit 4ebb197
Showing
3 changed files
with
54 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Litipk\BigNumbers\Decimal; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
class issue53Test extends TestCase | ||
{ | ||
public function test_that_no_division_by_zero_is_performed_without_explicit_scale() | ||
{ | ||
$d1 = Decimal::create(192078120.5); | ||
$d2 = Decimal::create(31449600); | ||
|
||
$d1->div($d2); | ||
|
||
// We are asserting that no exception is thrown | ||
$this->assertTrue(true); | ||
} | ||
|
||
public function test_that_no_division_by_zero_is_performed_with_explicit_scale() | ||
{ | ||
$d1 = Decimal::create(192078120.5, 28); | ||
$d2 = Decimal::create(31449600, 28); | ||
|
||
$d1->div($d2); | ||
|
||
// We are asserting that no exception is thrown | ||
$this->assertTrue(true); | ||
} | ||
} |