diff --git a/src/Traits/TenantAwareCommand.php b/src/Traits/TenantAwareCommand.php index 6cdb22e8..2d18a265 100644 --- a/src/Traits/TenantAwareCommand.php +++ b/src/Traits/TenantAwareCommand.php @@ -26,6 +26,8 @@ trait TenantAwareCommand $this->laravel->call([$this, 'handle']); }); } + + return 1; } /** diff --git a/tests/Etc/AddUserCommand.php b/tests/Etc/AddUserCommand.php new file mode 100644 index 00000000..7df7ee6d --- /dev/null +++ b/tests/Etc/AddUserCommand.php @@ -0,0 +1,35 @@ +save(); + $tenant2 = Tenant::new()->save(); + + $this->artisan('user:add')->assertExitCode(1); + + tenancy()->initializeTenancy($tenant1); + $this->assertNotEmpty(User::all()); + tenancy()->endTenancy() + + tenancy()->initializeTenancy($tenant2); + $this->assertNotEmpty(User::all()); + tenancy()->endTenancy() + } +}