mirror of
https://github.com/archtechx/money.git
synced 2025-12-12 11:24:03 +00:00
Add L10 support (#20)
* Add L10 support * Upgrade phpstan * Set `archtechx/helpers` version * Fix PHPStan errors * Try using older PHPStan version * Revert PHPStan downgrade * Delete immutability tests * Bring back immutability tests * Correct typehint * Update immutability tests * Remove L8 support * Allow PHP 8.0, run tests for 8.0 as well * Swap Laravel 9 & 10 * Add setup-php step * Revert formatting changes * Fix formatting * Revert adding setup-php * Try adding setup-php * Change formatting * Remove PHP 8.0 * Fix formatting
This commit is contained in:
parent
b1b02f459d
commit
b50e49358a
6 changed files with 29 additions and 16 deletions
|
|
@ -7,19 +7,23 @@ use ArchTech\Money\Tests\Currencies\CZK;
|
|||
use ArchTech\Money\Tests\Currencies\EUR;
|
||||
|
||||
test('Money value is immutable', function () {
|
||||
pest()->expectError();
|
||||
|
||||
$money = money(100);
|
||||
|
||||
$money->value = 200;
|
||||
try {
|
||||
$money->value = 200;
|
||||
} catch (Throwable $th) {
|
||||
expect($th)->toBeInstanceOf(Error::class);
|
||||
}
|
||||
});
|
||||
|
||||
test('Money currency is immutable', function () {
|
||||
pest()->expectError();
|
||||
|
||||
$money = money(100);
|
||||
|
||||
$money->currency = 'EUR';
|
||||
try {
|
||||
$money->currency = 'EUR';
|
||||
} catch (Throwable $th) {
|
||||
expect($th)->toBeInstanceOf(Error::class);
|
||||
}
|
||||
});
|
||||
|
||||
test('money can be created from a decimal value', function () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue