Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Console/OwnerSwapTest.php
Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | public function testHandle(): void | ||||
$target_customer = $this->getMollieCustomer($target_wallet->getSetting('mollie_id')); | $target_customer = $this->getMollieCustomer($target_wallet->getSetting('mollie_id')); | ||||
$this->assertSame($customer->id, $target_customer->id); | $this->assertSame($customer->id, $target_customer->id); | ||||
$this->assertTrue($customer->email != $target_customer->email); | $this->assertTrue($customer->email != $target_customer->email); | ||||
$this->assertSame($target_wallet->id . '@private.' . \config('app.domain'), $target_customer->email); | $this->assertSame($target_wallet->id . '@private.' . \config('app.domain'), $target_customer->email); | ||||
// Test case when the target user does not belong to the same account | // Test case when the target user does not belong to the same account | ||||
$john = $this->getTestUser('john@kolab.org'); | $john = $this->getTestUser('john@kolab.org'); | ||||
$owner->entitlement()->update(['wallet_id' => $john->wallets->first()->id]); | $owner->entitlements()->update(['wallet_id' => $john->wallets->first()->id]); | ||||
$code = \Artisan::call("owner:swap user2@owner-swap.com user1@owner-swap.com"); | $code = \Artisan::call("owner:swap user2@owner-swap.com user1@owner-swap.com"); | ||||
$output = trim(\Artisan::output()); | $output = trim(\Artisan::output()); | ||||
$this->assertSame(1, $code); | $this->assertSame(1, $code); | ||||
$this->assertSame("The target user does not belong to the same account.", $output); | $this->assertSame("The target user does not belong to the same account.", $output); | ||||
} | } | ||||
/** | /** | ||||
Show All 24 Lines |