Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/WalletTest.php
Show First 20 Lines • Show All 132 Lines • ▼ Show 20 Lines | public function testAddWalletController(): void | ||||
$userB = $this->getTestUser('WalletControllerB@WalletController.com'); | $userB = $this->getTestUser('WalletControllerB@WalletController.com'); | ||||
$userA->wallets()->each( | $userA->wallets()->each( | ||||
function ($wallet) use ($userB) { | function ($wallet) use ($userB) { | ||||
$wallet->addController($userB); | $wallet->addController($userB); | ||||
} | } | ||||
); | ); | ||||
$this->assertTrue($userB->accounts()->count() == 1); | $this->assertTrue( | ||||
$userB->accounts()->count() == 1, | |||||
"number of accounts (1 expected): {$userB->accounts()->count()}" | |||||
); | |||||
$aWallet = $userA->wallets()->get(); | $aWallet = $userA->wallets()->get(); | ||||
$bAccount = $userB->accounts()->get(); | $bAccount = $userB->accounts()->get(); | ||||
$this->assertTrue($bAccount[0]->id === $aWallet[0]->id); | $this->assertTrue($bAccount[0]->id === $aWallet[0]->id); | ||||
} | } | ||||
/** | /** | ||||
Show All 24 Lines |