diff --git a/src/app/Console/Commands/UserAddAlias.php b/src/app/Console/Commands/User/AddAliasCommand.php rename from src/app/Console/Commands/UserAddAlias.php rename to src/app/Console/Commands/User/AddAliasCommand.php --- a/src/app/Console/Commands/UserAddAlias.php +++ b/src/app/Console/Commands/User/AddAliasCommand.php @@ -1,11 +1,11 @@ getUser($this->argument('user')); if (!$user) { + $this->error("User not found."); return 1; } diff --git a/src/app/Console/Commands/UserAssignSku.php b/src/app/Console/Commands/User/AssignSkuCommand.php rename from src/app/Console/Commands/UserAssignSku.php rename to src/app/Console/Commands/User/AssignSkuCommand.php --- a/src/app/Console/Commands/UserAssignSku.php +++ b/src/app/Console/Commands/User/AssignSkuCommand.php @@ -1,10 +1,10 @@ getUser($this->argument('user')); if (!$user) { - $this->error("Unable to find the user {$this->argument('user')}."); + $this->error("User not found."); return 1; } diff --git a/src/app/Console/Commands/UserDomains.php b/src/app/Console/Commands/User/DomainsCommand.php rename from src/app/Console/Commands/UserDomains.php rename to src/app/Console/Commands/User/DomainsCommand.php --- a/src/app/Console/Commands/UserDomains.php +++ b/src/app/Console/Commands/User/DomainsCommand.php @@ -1,24 +1,24 @@ getUser($this->argument('userid')); + $user = $this->getUser($this->argument('user')); if (!$user) { + $this->error("User not found."); return 1; } foreach ($user->domains() as $domain) { - $this->info("{$domain->namespace}"); + $this->info($domain->namespace); } } } diff --git a/src/app/Console/Commands/UserEntitlements.php b/src/app/Console/Commands/User/EntitlementsCommand.php rename from src/app/Console/Commands/UserEntitlements.php rename to src/app/Console/Commands/User/EntitlementsCommand.php --- a/src/app/Console/Commands/UserEntitlements.php +++ b/src/app/Console/Commands/User/EntitlementsCommand.php @@ -1,10 +1,10 @@ getUser($this->argument('userid')); if (!$user) { + $this->error("User not found."); return 1; } - $this->info("Found user: {$user->id}"); - $skus_counted = []; foreach ($user->entitlements as $entitlement) { @@ -47,7 +46,7 @@ foreach ($skus_counted as $id => $qty) { $sku = \App\Sku::find($id); - $this->info("SKU: {$sku->title} ({$qty})"); + $this->info("{$sku->title}: {$qty}"); } } } diff --git a/src/app/Console/Commands/UserForceDelete.php b/src/app/Console/Commands/User/ForceDeleteCommand.php rename from src/app/Console/Commands/UserForceDelete.php rename to src/app/Console/Commands/User/ForceDeleteCommand.php --- a/src/app/Console/Commands/UserForceDelete.php +++ b/src/app/Console/Commands/User/ForceDeleteCommand.php @@ -1,11 +1,11 @@ getUser($this->argument('user'), true); if (!$user) { + $this->error("User not found."); return 1; } if (!$user->trashed()) { - $this->error('The user is not yet deleted'); + $this->error("The user is not yet deleted."); return 1; } diff --git a/src/app/Console/Commands/User/GreylistCommand.php b/src/app/Console/Commands/User/GreylistCommand.php --- a/src/app/Console/Commands/User/GreylistCommand.php +++ b/src/app/Console/Commands/User/GreylistCommand.php @@ -21,16 +21,6 @@ protected $description = 'List currently greylisted delivery attempts for the user.'; /** - * Create a new command instance. - * - * @return void - */ - public function __construct() - { - parent::__construct(); - } - - /** * Execute the console command. * * @return mixed diff --git a/src/app/Console/Commands/UserRestore.php b/src/app/Console/Commands/User/RestoreCommand.php rename from src/app/Console/Commands/UserRestore.php rename to src/app/Console/Commands/User/RestoreCommand.php --- a/src/app/Console/Commands/UserRestore.php +++ b/src/app/Console/Commands/User/RestoreCommand.php @@ -1,11 +1,11 @@ getUser($this->argument('user'), true); if (!$user) { - $this->error('User not found.'); + $this->error("User not found."); return 1; } if (!$user->trashed()) { - $this->error('The user is not yet deleted.'); + $this->error("The user is not deleted."); return 1; } diff --git a/src/app/Console/Commands/UserDiscount.php b/src/app/Console/Commands/User/SetDiscountCommand.php rename from src/app/Console/Commands/UserDiscount.php rename to src/app/Console/Commands/User/SetDiscountCommand.php --- a/src/app/Console/Commands/UserDiscount.php +++ b/src/app/Console/Commands/User/SetDiscountCommand.php @@ -1,17 +1,17 @@ getUser($this->argument('user')); if (!$user) { + $this->error("User not found."); return 1; } - $this->info("Found user {$user->id}"); - if ($this->argument('discount') === '0') { $discount = null; } else { $discount = $this->getObject(\App\Discount::class, $this->argument('discount')); if (!$discount) { + $this->error("Discount not found."); return 1; } } diff --git a/src/app/Console/Commands/User/StatusCommand.php b/src/app/Console/Commands/User/StatusCommand.php --- a/src/app/Console/Commands/User/StatusCommand.php +++ b/src/app/Console/Commands/User/StatusCommand.php @@ -2,7 +2,8 @@ namespace App\Console\Commands\User; -use Illuminate\Console\Command; +use App\Console\Command; +use App\User; class StatusCommand extends Command { @@ -21,40 +22,26 @@ protected $description = "Show a user's status."; /** - * Create a new command instance. - * - * @return void - */ - public function __construct() - { - parent::__construct(); - } - - /** * Execute the console command. * * @return mixed */ public function handle() { - $user = \App\User::withTrashed()->withEnvTenantContext()->where('email', $this->argument('user'))->first(); - - if (!$user) { - $user = \App\User::withTrashed()->withEnvTenantContext()->where('id', $this->argument('user'))->first(); - } + $user = $this->getUser($this->argument('user'), true); if (!$user) { - $this->error("No such user '" . $this->argument('user') . "' within this tenant context."); - $this->info("Try ./artisan scalpel:user:read --attr=email --attr=tenant_id " . $this->argument('user')); + $this->error("User not found."); + $this->error("Try ./artisan scalpel:user:read --attr=email --attr=tenant_id " . $this->argument('user')); return 1; } $statuses = [ - 'active' => \App\User::STATUS_ACTIVE, - 'suspended' => \App\User::STATUS_SUSPENDED, - 'deleted' => \App\User::STATUS_DELETED, - 'ldapReady' => \App\User::STATUS_LDAP_READY, - 'imapReady' => \App\User::STATUS_IMAP_READY, + 'active' => User::STATUS_ACTIVE, + 'suspended' => User::STATUS_SUSPENDED, + 'deleted' => User::STATUS_DELETED, + 'ldapReady' => User::STATUS_LDAP_READY, + 'imapReady' => User::STATUS_IMAP_READY, ]; $user_state = []; diff --git a/src/app/Console/Commands/UserSuspend.php b/src/app/Console/Commands/User/SuspendCommand.php rename from src/app/Console/Commands/UserSuspend.php rename to src/app/Console/Commands/User/SuspendCommand.php --- a/src/app/Console/Commands/UserSuspend.php +++ b/src/app/Console/Commands/User/SuspendCommand.php @@ -1,11 +1,10 @@ getUser($this->argument('user')); if (!$user) { + $this->error("User not found."); return 1; } - $this->info("Found user: {$user->id}"); - $user->suspend(); } } diff --git a/src/app/Console/Commands/UserUnsuspend.php b/src/app/Console/Commands/User/UnsuspendCommand.php rename from src/app/Console/Commands/UserUnsuspend.php rename to src/app/Console/Commands/User/UnsuspendCommand.php --- a/src/app/Console/Commands/UserUnsuspend.php +++ b/src/app/Console/Commands/User/UnsuspendCommand.php @@ -1,10 +1,10 @@ getUser($this->argument('user')); if (!$user) { + $this->error("User not found."); return 1; } - $this->info("Found user {$user->id}"); - $user->unsuspend(); } } diff --git a/src/app/Console/Commands/UserVerify.php b/src/app/Console/Commands/User/VerifyCommand.php rename from src/app/Console/Commands/UserVerify.php rename to src/app/Console/Commands/User/VerifyCommand.php --- a/src/app/Console/Commands/UserVerify.php +++ b/src/app/Console/Commands/User/VerifyCommand.php @@ -1,10 +1,10 @@ getUser($this->argument('user')); if (!$user) { + $this->error("User not found."); return 1; } - $this->info("Found user: {$user->id}"); - $job = new \App\Jobs\User\VerifyJob($user->id); $job->handle(); + + // TODO: We should check the job result and print an error on failure } } diff --git a/src/app/Console/Commands/UserWallets.php b/src/app/Console/Commands/User/WalletsCommand.php rename from src/app/Console/Commands/UserWallets.php rename to src/app/Console/Commands/User/WalletsCommand.php --- a/src/app/Console/Commands/UserWallets.php +++ b/src/app/Console/Commands/User/WalletsCommand.php @@ -1,10 +1,10 @@ getUser($this->argument('user')); if (!$user) { + $this->error("User not found."); return 1; } diff --git a/src/app/Console/Commands/UserDelete.php b/src/app/Console/Commands/UserDelete.php deleted file mode 100644 --- a/src/app/Console/Commands/UserDelete.php +++ /dev/null @@ -1,38 +0,0 @@ -getUser($this->argument('user')); - - if (!$user) { - return 1; - } - - $user->delete(); - } -} diff --git a/src/tests/Feature/Console/DomainsTest.php b/src/tests/Feature/Console/DomainsTest.php --- a/src/tests/Feature/Console/DomainsTest.php +++ b/src/tests/Feature/Console/DomainsTest.php @@ -1,6 +1,6 @@ markTestIncomplete(); } } diff --git a/src/tests/Feature/Console/UserRestoreTest.php b/src/tests/Feature/Console/User/AddAliasTest.php rename from src/tests/Feature/Console/UserRestoreTest.php rename to src/tests/Feature/Console/User/AddAliasTest.php --- a/src/tests/Feature/Console/UserRestoreTest.php +++ b/src/tests/Feature/Console/User/AddAliasTest.php @@ -1,11 +1,10 @@ assertSame(1, $code); $this->assertSame("User not found.", $output); - // Create a user account for delete $user = $this->getTestUser('user@force-delete.com'); $domain = $this->getTestDomain('force-delete.com', [ 'status' => \App\Domain::STATUS_NEW, @@ -52,29 +49,29 @@ $package_domain = \App\Package::withEnvTenantContext()->where('title', 'domain-hosting')->first(); $user->assignPackage($package_kolab); $domain->assignPackage($package_domain, $user); - $wallet = $user->wallets()->first(); - $entitlements = $wallet->entitlements->pluck('id')->all(); - - $this->assertCount(8, $entitlements); - // Non-deleted user - $code = \Artisan::call("user:restore {$user->email}"); + // Invalid alias + $code = \Artisan::call("user:add-alias {$user->email} invalid"); $output = trim(\Artisan::output()); - $this->assertSame(1, $code); - $this->assertSame("The user is not yet deleted.", $output); - - $user->delete(); - $this->assertTrue($user->trashed()); - $this->assertTrue($domain->fresh()->trashed()); + $this->assertSame(1, $code); + $this->assertSame("The specified alias is invalid.", $output); - // Deleted user - $code = \Artisan::call("user:restore {$user->email}"); + // Test success + $code = \Artisan::call("user:add-alias {$user->email} test@force-delete.com"); $output = trim(\Artisan::output()); + $this->assertSame(0, $code); $this->assertSame("", $output); + $this->assertCount(1, $user->aliases()->where('alias', 'test@force-delete.com')->get()); + + // Alias already exists + $code = \Artisan::call("user:add-alias {$user->email} test@force-delete.com"); + $output = trim(\Artisan::output()); + + $this->assertSame(1, $code); + $this->assertSame("Address is already assigned to the user.", $output); - $this->assertFalse($user->fresh()->trashed()); - $this->assertFalse($domain->fresh()->trashed()); + // TODO: test --force option } } diff --git a/src/tests/Feature/Console/UserAssignSkuTest.php b/src/tests/Feature/Console/User/AssignSkuTest.php rename from src/tests/Feature/Console/UserAssignSkuTest.php rename to src/tests/Feature/Console/User/AssignSkuTest.php --- a/src/tests/Feature/Console/UserAssignSkuTest.php +++ b/src/tests/Feature/Console/User/AssignSkuTest.php @@ -1,10 +1,10 @@ artisan('user:assign-sku unknown@unknown.org ' . $sku->id) ->assertExitCode(1) - ->expectsOutput("Unable to find the user unknown@unknown.org."); + ->expectsOutput("User not found."); $this->artisan('user:assign-sku ' . $user->email . ' unknownsku') ->assertExitCode(1) diff --git a/src/tests/Feature/Console/User/DeleteTest.php b/src/tests/Feature/Console/User/DeleteTest.php new file mode 100644 --- /dev/null +++ b/src/tests/Feature/Console/User/DeleteTest.php @@ -0,0 +1,58 @@ +deleteTestUser('user@force-delete.com'); + } + + /** + * {@inheritDoc} + */ + public function tearDown(): void + { + $this->deleteTestUser('user@force-delete.com'); + + parent::tearDown(); + } + + /** + * Test the command + */ + public function testHandle(): void + { + // Non-existing user + $code = \Artisan::call("user:delete unknown"); + $output = trim(\Artisan::output()); + + $this->assertSame(1, $code); + $this->assertSame("No such user unknown", $output); + + $user = $this->getTestUser('user@force-delete.com'); + + // Test success + $code = \Artisan::call("user:delete {$user->email}"); + $output = trim(\Artisan::output()); + + $this->assertSame(0, $code); + $this->assertSame("", $output); + $this->assertTrue($user->fresh()->trashed()); + + // User already deleted + $code = \Artisan::call("user:delete {$user->email}"); + $output = trim(\Artisan::output()); + + $this->assertSame(1, $code); + $this->assertSame("No such user user@force-delete.com", $output); + } +} diff --git a/src/tests/Feature/Console/User/DomainsTest.php b/src/tests/Feature/Console/User/DomainsTest.php new file mode 100644 --- /dev/null +++ b/src/tests/Feature/Console/User/DomainsTest.php @@ -0,0 +1,27 @@ +assertSame(1, $code); + $this->assertSame("User not found.", $output); + + $code = \Artisan::call("user:domains john@kolab.org"); + $output = trim(\Artisan::output()); + + $this->assertSame(0, $code); + $this->assertTrue(strpos($output, "kolab.org") !== false); + $this->assertTrue(strpos($output, \config('app.domain')) !== false); + } +} diff --git a/src/tests/Feature/Console/User/EntitlementsTest.php b/src/tests/Feature/Console/User/EntitlementsTest.php new file mode 100644 --- /dev/null +++ b/src/tests/Feature/Console/User/EntitlementsTest.php @@ -0,0 +1,28 @@ +assertSame(1, $code); + $this->assertSame("User not found.", $output); + + $code = \Artisan::call("user:entitlements john@kolab.org"); + $output = trim(\Artisan::output()); + + $this->assertSame(0, $code); + $this->assertTrue(strpos($output, "storage: 5") !== false); + $this->assertTrue(strpos($output, "mailbox: 1") !== false); + $this->assertTrue(strpos($output, "groupware: 1") !== false); + } +} diff --git a/src/tests/Feature/Console/UserForceDeleteTest.php b/src/tests/Feature/Console/User/ForceDeleteTest.php rename from src/tests/Feature/Console/UserForceDeleteTest.php rename to src/tests/Feature/Console/User/ForceDeleteTest.php --- a/src/tests/Feature/Console/UserForceDeleteTest.php +++ b/src/tests/Feature/Console/User/ForceDeleteTest.php @@ -1,11 +1,11 @@ markTestIncomplete(); diff --git a/src/tests/Feature/Console/UserRestoreTest.php b/src/tests/Feature/Console/User/RestoreTest.php rename from src/tests/Feature/Console/UserRestoreTest.php rename to src/tests/Feature/Console/User/RestoreTest.php --- a/src/tests/Feature/Console/UserRestoreTest.php +++ b/src/tests/Feature/Console/User/RestoreTest.php @@ -1,11 +1,11 @@ email}"); $output = trim(\Artisan::output()); $this->assertSame(1, $code); - $this->assertSame("The user is not yet deleted.", $output); + $this->assertSame("The user is not deleted.", $output); $user->delete(); diff --git a/src/tests/Feature/Console/User/SetDiscountTest.php b/src/tests/Feature/Console/User/SetDiscountTest.php new file mode 100644 --- /dev/null +++ b/src/tests/Feature/Console/User/SetDiscountTest.php @@ -0,0 +1,64 @@ +deleteTestUser('wallets-controller@kolabnow.com'); + } + + /** + * {@inheritDoc} + */ + public function tearDown(): void + { + $this->deleteTestUser('wallets-controller@kolabnow.com'); + + parent::tearDown(); + } + + /** + * Test command runs + */ + public function testHandle(): void + { + $user = $this->getTestUser('wallets-controller@kolabnow.com'); + $wallet = $user->wallets()->first(); + $discount = \App\Discount::withObjectTenantContext($user)->where('discount', 100)->first(); + + // Invalid user id + $code = \Artisan::call("user:set-discount 123 123"); + $output = trim(\Artisan::output()); + $this->assertSame(1, $code); + $this->assertSame("User not found.", $output); + + // Invalid discount id + $code = \Artisan::call("user:set-discount {$user->id} 123"); + $output = trim(\Artisan::output()); + $this->assertSame(1, $code); + $this->assertSame("Discount not found.", $output); + + // Assign a discount + $code = \Artisan::call("user:set-discount {$user->id} {$discount->id}"); + $output = trim(\Artisan::output()); + $this->assertSame(0, $code); + $this->assertSame("", $output); + $this->assertSame($discount->id, $wallet->fresh()->discount_id); + + // Remove the discount + $code = \Artisan::call("user:set-discount {$user->id} 0"); + $output = trim(\Artisan::output()); + $this->assertSame(0, $code); + $this->assertSame("", $output); + $this->assertNull($wallet->fresh()->discount_id); + } +} diff --git a/src/tests/Feature/Console/User/StatusTest.php b/src/tests/Feature/Console/User/StatusTest.php new file mode 100644 --- /dev/null +++ b/src/tests/Feature/Console/User/StatusTest.php @@ -0,0 +1,29 @@ +assertSame(1, $code); + $this->assertSame( + "User not found.\nTry ./artisan scalpel:user:read --attr=email --attr=tenant_id unknown", + $output + ); + + $code = \Artisan::call("user:status john@kolab.org"); + $output = trim(\Artisan::output()); + + $this->assertSame(0, $code); + $this->assertSame("Status: active,ldapReady,imapReady", $output); + } +} diff --git a/src/tests/Feature/Console/User/SuspendTest.php b/src/tests/Feature/Console/User/SuspendTest.php new file mode 100644 --- /dev/null +++ b/src/tests/Feature/Console/User/SuspendTest.php @@ -0,0 +1,54 @@ +deleteTestUser('user@force-delete.com'); + } + + /** + * {@inheritDoc} + */ + public function tearDown(): void + { + $this->deleteTestUser('user@force-delete.com'); + + parent::tearDown(); + } + + /** + * Test the command + */ + public function testHandle(): void + { + Queue::fake(); + + // Non-existing user + $code = \Artisan::call("user:suspend unknown"); + $output = trim(\Artisan::output()); + + $this->assertSame(1, $code); + $this->assertSame("User not found.", $output); + + $user = $this->getTestUser('user@force-delete.com'); + + // Test success + $code = \Artisan::call("user:suspend {$user->email}"); + $output = trim(\Artisan::output()); + + $this->assertSame(0, $code); + $this->assertSame("", $output); + $this->assertTrue($user->fresh()->isSuspended()); + } +} diff --git a/src/tests/Feature/Console/User/UnsuspendTest.php b/src/tests/Feature/Console/User/UnsuspendTest.php new file mode 100644 --- /dev/null +++ b/src/tests/Feature/Console/User/UnsuspendTest.php @@ -0,0 +1,55 @@ +deleteTestUser('user@force-delete.com'); + } + + /** + * {@inheritDoc} + */ + public function tearDown(): void + { + $this->deleteTestUser('user@force-delete.com'); + + parent::tearDown(); + } + + /** + * Test the command + */ + public function testHandle(): void + { + Queue::fake(); + + // Non-existing user + $code = \Artisan::call("user:unsuspend unknown"); + $output = trim(\Artisan::output()); + + $this->assertSame(1, $code); + $this->assertSame("User not found.", $output); + + $user = $this->getTestUser('user@force-delete.com'); + $user->suspend(); + + // Test success + $code = \Artisan::call("user:unsuspend {$user->email}"); + $output = trim(\Artisan::output()); + + $this->assertSame(0, $code); + $this->assertSame("", $output); + $this->assertFalse($user->fresh()->isSuspended()); + } +} diff --git a/src/tests/Feature/Console/User/VerifyTest.php b/src/tests/Feature/Console/User/VerifyTest.php new file mode 100644 --- /dev/null +++ b/src/tests/Feature/Console/User/VerifyTest.php @@ -0,0 +1,55 @@ +deleteTestUser('user@force-delete.com'); + } + + /** + * {@inheritDoc} + */ + public function tearDown(): void + { + $this->deleteTestUser('user@force-delete.com'); + + parent::tearDown(); + } + + /** + * Test the command + */ + public function testHandle(): void + { + Queue::fake(); + + // Non-existing user + $code = \Artisan::call("user:verify unknown"); + $output = trim(\Artisan::output()); + + $this->assertSame(1, $code); + $this->assertSame("User not found.", $output); + + $user = $this->getTestUser('user@force-delete.com'); + + // Test success + $code = \Artisan::call("user:verify {$user->email}"); + $output = trim(\Artisan::output()); + + $this->assertSame(0, $code); + $this->assertSame("", $output); + + // TODO: Test the verification utility error conditions + } +} diff --git a/src/tests/Feature/Console/User/WalletsTest.php b/src/tests/Feature/Console/User/WalletsTest.php new file mode 100644 --- /dev/null +++ b/src/tests/Feature/Console/User/WalletsTest.php @@ -0,0 +1,29 @@ +assertSame(1, $code); + $this->assertSame("User not found.", $output); + + $user = $this->getTestUser('john@kolab.org'); + $wallet = $user->wallets()->first(); + + $code = \Artisan::call("user:wallets john@kolab.org"); + $output = trim(\Artisan::output()); + + $this->assertSame(0, $code); + $this->assertSame(trim("{$wallet->id} {$wallet->description}"), $output); + } +} diff --git a/src/tests/Feature/Console/UserDomainsTest.php b/src/tests/Feature/Console/UserDomainsTest.php deleted file mode 100644 --- a/src/tests/Feature/Console/UserDomainsTest.php +++ /dev/null @@ -1,16 +0,0 @@ -artisan('user:domains john@kolab.org') - ->assertExitCode(0); - - $this->markTestIncomplete(); - } -} diff --git a/src/tests/Feature/Console/UserEntitlementsTest.php b/src/tests/Feature/Console/UserEntitlementsTest.php deleted file mode 100644 --- a/src/tests/Feature/Console/UserEntitlementsTest.php +++ /dev/null @@ -1,16 +0,0 @@ -artisan('user:entitlements john@kolab.org') - ->assertExitCode(0); - - $this->markTestIncomplete(); - } -} diff --git a/src/tests/Feature/Console/UserSettingsTest.php b/src/tests/Feature/Console/UserSettingsTest.php new file mode 100644 --- /dev/null +++ b/src/tests/Feature/Console/UserSettingsTest.php @@ -0,0 +1,22 @@ +assertSame(0, $code); + + // Test the output and extra arguments + $this->markTestIncomplete(); + } +} diff --git a/src/tests/Feature/Console/UserWalletsTest.php b/src/tests/Feature/Console/UserWalletsTest.php deleted file mode 100644 --- a/src/tests/Feature/Console/UserWalletsTest.php +++ /dev/null @@ -1,16 +0,0 @@ -artisan('user:wallets john@kolab.org') - ->assertExitCode(0); - - $this->markTestIncomplete(); - } -} diff --git a/src/tests/Feature/Console/DomainsTest.php b/src/tests/Feature/Console/UsersTest.php copy from src/tests/Feature/Console/DomainsTest.php copy to src/tests/Feature/Console/UsersTest.php --- a/src/tests/Feature/Console/DomainsTest.php +++ b/src/tests/Feature/Console/UsersTest.php @@ -1,27 +1,28 @@ first(); + $john = $this->getTestUser('john@kolab.org'); // Existing domain - $code = \Artisan::call("domains"); + $code = \Artisan::call("users"); $output = trim(\Artisan::output()); $this->assertSame(0, $code); - $this->assertTrue(strpos($output, (string) $domain->id) !== false); + $this->assertTrue(strpos($output, (string) $john->id) !== false); // TODO: Test --deleted argument // TODO: Test output format and other attributes // TODO: Test tenant context + $this->markTestIncomplete(); } }