Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/WalletTest.php
Show First 20 Lines • Show All 271 Lines • ▼ Show 20 Lines | public function testAddWalletController(): void | ||||
$aWallet = $userA->wallets()->first(); | $aWallet = $userA->wallets()->first(); | ||||
$bAccount = $userB->accounts()->first(); | $bAccount = $userB->accounts()->first(); | ||||
$this->assertTrue($bAccount->id === $aWallet->id); | $this->assertTrue($bAccount->id === $aWallet->id); | ||||
} | } | ||||
/** | /** | ||||
* Test Wallet::isController() | |||||
*/ | |||||
public function testIsController(): void | |||||
{ | |||||
$john = $this->getTestUser('john@kolab.org'); | |||||
$jack = $this->getTestUser('jack@kolab.org'); | |||||
$ned = $this->getTestUser('ned@kolab.org'); | |||||
$wallet = $jack->wallet(); | |||||
$this->assertTrue($wallet->isController($john)); | |||||
$this->assertTrue($wallet->isController($ned)); | |||||
$this->assertFalse($wallet->isController($jack)); | |||||
} | |||||
/** | |||||
* Verify controllers can also be removed from wallets. | * Verify controllers can also be removed from wallets. | ||||
*/ | */ | ||||
public function testRemoveWalletController(): void | public function testRemoveWalletController(): void | ||||
{ | { | ||||
$userA = $this->getTestUser('WalletController2A@WalletController.com'); | $userA = $this->getTestUser('WalletController2A@WalletController.com'); | ||||
$userB = $this->getTestUser('WalletController2B@WalletController.com'); | $userB = $this->getTestUser('WalletController2B@WalletController.com'); | ||||
$userA->wallets()->each( | $userA->wallets()->each( | ||||
▲ Show 20 Lines • Show All 144 Lines • Show Last 20 Lines |