Skip to content

Commit

Permalink
checking the Wallet class extensibility
Browse files Browse the repository at this point in the history
  • Loading branch information
rez1dent3 committed Sep 13, 2023
1 parent fa4e182 commit 1632e28
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/Infra/PackageModels/MyWallet.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

declare(strict_types=1);

namespace Bavix\Wallet\Test\Infra\PackageModels;

final class MyWallet extends \Bavix\Wallet\Models\Wallet
{
public function helloWorld(): string
{
return 'hello world';
}
}
31 changes: 31 additions & 0 deletions tests/Units/Expand/WalletTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

namespace Bavix\Wallet\Test\Units\Expand;

use Bavix\Wallet\Test\Infra\Factories\BuyerFactory;
use Bavix\Wallet\Test\Infra\Models\Buyer;
use Bavix\Wallet\Test\Infra\PackageModels\MyWallet;
use Bavix\Wallet\Test\Infra\TestCase;

/**
* @internal
*/
final class WalletTest extends TestCase
{
public function testAddMethod(): void
{
config([
'wallet.wallet.model' => MyWallet::class,
]);

/** @var Buyer $buyer */
$buyer = BuyerFactory::new()->create();

/** @var MyWallet $wallet */
$wallet = $buyer->wallet;

self::assertSame('hello world', $wallet->helloWorld());
}
}

0 comments on commit 1632e28

Please sign in to comment.