mirror of
https://github.com/archtechx/money.git
synced 2025-12-13 03:34:04 +00:00
Fixes #9
This commit is contained in:
parent
4474c2b115
commit
35f6de2212
2 changed files with 12 additions and 2 deletions
|
|
@ -126,6 +126,16 @@ test('the default currency can have any rate', function () {
|
|||
)->toBe('0.54 €');
|
||||
});
|
||||
|
||||
test('change currency rate on convertion', function () {
|
||||
currencies()->add([new CZK(rate: 1), new EUR(rate: 0.5)]);
|
||||
|
||||
currencies()->setDefault(CZK::class);
|
||||
|
||||
expect(
|
||||
money(200, 'CZK')->convertTo(EUR::class)->formatted()
|
||||
)->toBe('1.00 €');
|
||||
});
|
||||
|
||||
test('the getCode method accepts any currency format', function () {
|
||||
expect(currencies()->getCode(USD::class))->toBe('USD');
|
||||
expect(currencies()->getCode(new USD))->toBe('USD');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue