File tree Expand file tree Collapse file tree 4 files changed +18
-5
lines changed Expand file tree Collapse file tree 4 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 3333 },
3434 "require-dev" : {
3535 "brianium/paratest" : " ^7.3" ,
36- "cknow/laravel-money" : " ^7.2" ,
3736 "ergebnis/phpstan-rules" : " ^2.1" ,
3837 "infection/infection" : " ~0.27" ,
3938 "laravel/cashier" : " ^15.0" ,
Original file line number Diff line number Diff line change 44
55namespace Bavix \Wallet \Test \Infra \PackageModels ;
66
7- use Cknow \ Money \Money ;
7+ use Bavix \ Wallet \ Test \ Infra \ Values \Money ;
88
99/**
1010 * Class Transaction.
@@ -17,7 +17,7 @@ final class TransactionMoney extends \Bavix\Wallet\Models\Transaction
1717
1818 public function getCurrencyAttribute (): Money
1919 {
20- $ this ->currency ??= \money ($ this ->amount , $ this ->meta ['currency ' ] ?? 'USD ' );
20+ $ this ->currency ??= new Money ($ this ->amount , $ this ->meta ['currency ' ] ?? 'USD ' );
2121
2222 return $ this ->currency ;
2323 }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Bavix \Wallet \Test \Infra \Values ;
6+
7+ final readonly class Money
8+ {
9+ public function __construct (
10+ public string $ amount ,
11+ public string $ currency ,
12+ ) {
13+ }
14+ }
Original file line number Diff line number Diff line change @@ -53,8 +53,8 @@ public function testTransactionMoneyAttribute(): void
5353 self ::assertTrue ($ transaction ->getKey () > 0 );
5454 self ::assertSame ($ transaction ->amountInt , $ buyer ->balanceInt );
5555 self ::assertInstanceOf (TransactionMoney::class, $ transaction );
56- self ::assertSame ('1000 ' , $ transaction ->currency ->getAmount () );
57- self ::assertSame ('EUR ' , $ transaction ->currency ->getCurrency ()-> getCode () );
56+ self ::assertSame ('1000 ' , $ transaction ->currency ->amount );
57+ self ::assertSame ('EUR ' , $ transaction ->currency ->currency );
5858 }
5959
6060 public function testNoCustomAttribute (): void
You can’t perform that action at this time.
0 commit comments