From 826eca93caea28f69a0b0b12affb683a5aa40142 Mon Sep 17 00:00:00 2001 From: Maxim Babichev Date: Fri, 5 Jan 2024 19:44:48 +0300 Subject: [PATCH 1/2] drop depends --- tests/Infra/PackageModels/TransactionMoney.php | 4 ++-- tests/Infra/Values/Money.php | 14 ++++++++++++++ tests/Units/Domain/WalletExtensionTest.php | 4 ++-- 3 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 tests/Infra/Values/Money.php diff --git a/tests/Infra/PackageModels/TransactionMoney.php b/tests/Infra/PackageModels/TransactionMoney.php index 13dcd28ed..b9dfc13b4 100644 --- a/tests/Infra/PackageModels/TransactionMoney.php +++ b/tests/Infra/PackageModels/TransactionMoney.php @@ -4,7 +4,7 @@ namespace Bavix\Wallet\Test\Infra\PackageModels; -use Cknow\Money\Money; +use Bavix\Wallet\Test\Infra\Values\Money; /** * Class Transaction. @@ -17,7 +17,7 @@ final class TransactionMoney extends \Bavix\Wallet\Models\Transaction public function getCurrencyAttribute(): Money { - $this->currency ??= \money($this->amount, $this->meta['currency'] ?? 'USD'); + $this->currency ??= new Money($this->amount, $this->meta['currency'] ?? 'USD'); return $this->currency; } diff --git a/tests/Infra/Values/Money.php b/tests/Infra/Values/Money.php new file mode 100644 index 000000000..be8c160a3 --- /dev/null +++ b/tests/Infra/Values/Money.php @@ -0,0 +1,14 @@ +getKey() > 0); self::assertSame($transaction->amountInt, $buyer->balanceInt); self::assertInstanceOf(TransactionMoney::class, $transaction); - self::assertSame('1000', $transaction->currency->getAmount()); - self::assertSame('EUR', $transaction->currency->getCurrency()->getCode()); + self::assertSame('1000', $transaction->currency->amount); + self::assertSame('EUR', $transaction->currency->currency); } public function testNoCustomAttribute(): void From d2fe9bded9a233167ce13c75def67df334ab6436 Mon Sep 17 00:00:00 2001 From: Maxim Babichev Date: Fri, 5 Jan 2024 19:47:26 +0300 Subject: [PATCH 2/2] remove cknow/laravel-money --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 7aa9b6cde..f0fe678c2 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,6 @@ }, "require-dev": { "brianium/paratest": "^7.3", - "cknow/laravel-money": "^7.2", "ergebnis/phpstan-rules": "^2.1", "infection/infection": "~0.27", "laravel/cashier": "^15.0",