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 33
33
},
34
34
"require-dev" : {
35
35
"brianium/paratest" : " ^7.3" ,
36
- "cknow/laravel-money" : " ^7.2" ,
37
36
"ergebnis/phpstan-rules" : " ^2.1" ,
38
37
"infection/infection" : " ~0.27" ,
39
38
"laravel/cashier" : " ^15.0" ,
Original file line number Diff line number Diff line change 4
4
5
5
namespace Bavix \Wallet \Test \Infra \PackageModels ;
6
6
7
- use Cknow \ Money \Money ;
7
+ use Bavix \ Wallet \ Test \ Infra \ Values \Money ;
8
8
9
9
/**
10
10
* Class Transaction.
@@ -17,7 +17,7 @@ final class TransactionMoney extends \Bavix\Wallet\Models\Transaction
17
17
18
18
public function getCurrencyAttribute (): Money
19
19
{
20
- $ this ->currency ??= \money ($ this ->amount , $ this ->meta ['currency ' ] ?? 'USD ' );
20
+ $ this ->currency ??= new Money ($ this ->amount , $ this ->meta ['currency ' ] ?? 'USD ' );
21
21
22
22
return $ this ->currency ;
23
23
}
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
53
53
self ::assertTrue ($ transaction ->getKey () > 0 );
54
54
self ::assertSame ($ transaction ->amountInt , $ buyer ->balanceInt );
55
55
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 );
58
58
}
59
59
60
60
public function testNoCustomAttribute (): void
You can’t perform that action at this time.
0 commit comments