Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Feature/Console/User/DomainsTest.php
Show All 9 Lines | |||||
* Test command runs | * Test command runs | ||||
*/ | */ | ||||
public function testHandle(): void | public function testHandle(): void | ||||
{ | { | ||||
$code = \Artisan::call("user:domains unknown"); | $code = \Artisan::call("user:domains unknown"); | ||||
$output = trim(\Artisan::output()); | $output = trim(\Artisan::output()); | ||||
$this->assertSame(1, $code); | $this->assertSame(1, $code); | ||||
$this->assertSame("User not found.", $output); | $this->assertSame("No such user unknown", $output); | ||||
$code = \Artisan::call("user:domains john@kolab.org"); | $code = \Artisan::call("user:domains john@kolab.org --attr=namespace"); | ||||
$output = trim(\Artisan::output()); | $output = trim(\Artisan::output()); | ||||
$domain = $this->getTestDomain('kolab.org'); | |||||
$this->assertSame(0, $code); | $this->assertSame(0, $code); | ||||
$this->assertTrue(strpos($output, "kolab.org") !== false); | $this->assertSame("{$domain->id} {$domain->namespace}", $output); | ||||
$this->assertTrue(strpos($output, \config('app.domain')) !== false); | |||||
} | } | ||||
} | } |