mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 09:34:04 +00:00
[2.x] Add CreateTenant command (#153)
* Add CreateTenant command, fix TenantList output * Create command test
This commit is contained in:
parent
40f8fa346e
commit
d4472469f0
7 changed files with 69 additions and 5 deletions
|
|
@ -156,4 +156,16 @@ class CommandsTest extends TestCase
|
|||
Artisan::call('tenants:migrate-fresh');
|
||||
$this->assertFalse(DB::table('users')->exists());
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function create_command_works()
|
||||
{
|
||||
Artisan::call('tenants:create -d aaa.localhost -d bbb.localhost plan=free email=foo@test.local');
|
||||
$tenant = tenancy()->all()[1]; // a tenant is autocreated prior to this
|
||||
$data = $tenant->data;
|
||||
unset($data['id']);
|
||||
|
||||
$this->assertSame(['plan' => 'free', 'email' => 'foo@test.local'], $data);
|
||||
$this->assertSame(['aaa.localhost', 'bbb.localhost'], $tenant->domains);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue