Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Console/DomainRestoreTest.php
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | public function testHandle(): void | ||||
]); | ]); | ||||
$package_kolab = \App\Package::where('title', 'kolab')->first(); | $package_kolab = \App\Package::where('title', 'kolab')->first(); | ||||
$package_domain = \App\Package::where('title', 'domain-hosting')->first(); | $package_domain = \App\Package::where('title', 'domain-hosting')->first(); | ||||
$user->assignPackage($package_kolab); | $user->assignPackage($package_kolab); | ||||
$domain->assignPackage($package_domain, $user); | $domain->assignPackage($package_domain, $user); | ||||
$wallet = $user->wallets()->first(); | $wallet = $user->wallets()->first(); | ||||
$entitlements = $wallet->entitlements->pluck('id')->all(); | $entitlements = $wallet->entitlements->pluck('id')->all(); | ||||
$this->assertCount(5, $entitlements); | $this->assertCount(8, $entitlements); | ||||
// Non-deleted domain | // Non-deleted domain | ||||
$code = \Artisan::call("domain:restore force-delete.com"); | $code = \Artisan::call("domain:restore force-delete.com"); | ||||
$output = trim(\Artisan::output()); | $output = trim(\Artisan::output()); | ||||
$this->assertSame(1, $code); | $this->assertSame(1, $code); | ||||
$this->assertSame("The domain is not yet deleted.", $output); | $this->assertSame("The domain is not yet deleted.", $output); | ||||
$domain->delete(); | $domain->delete(); | ||||
Show All 25 Lines |