Skip to content

Commit 9ff70ee

Browse files
author
Babichev Maxim
committed
add unit's
1 parent e8d42cd commit 9ff70ee

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src/Traits/CanPay.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use Bavix\Wallet\Exceptions\ProductEnded;
66
use Bavix\Wallet\Interfaces\Product;
77
use Bavix\Wallet\Models\Transfer;
8-
use Bavix\Wallet\Models\Wallet;
98
use Illuminate\Database\Eloquent\Model;
109
use Illuminate\Database\Eloquent\ModelNotFoundException;
1110
use Illuminate\Support\Facades\DB;

tests/MultiWalletTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,4 +293,25 @@ public function testGetWallet(): void
293293
);
294294
}
295295

296+
/**
297+
* @return void
298+
*/
299+
public function testGetWalletOptimize(): void
300+
{
301+
/**
302+
* @var UserMulti $user
303+
*/
304+
$user = factory(UserMulti::class)->create();
305+
$names = \range('a', 'z');
306+
foreach ($names as $name) {
307+
$user->createWallet(\compact('name'));
308+
}
309+
310+
$user->load('wallets'); // optimize
311+
312+
foreach ($names as $name) {
313+
$this->assertEquals($name, $user->getWallet($name)->name);
314+
}
315+
}
316+
296317
}

0 commit comments

Comments
 (0)