mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 22:24:03 +00:00
Update CommandsTest.php
This commit is contained in:
parent
76e5777bc2
commit
debde0a103
1 changed files with 7 additions and 4 deletions
|
|
@ -121,14 +121,17 @@ test('rollback command works', function () {
|
|||
test('seed command works', function (){
|
||||
$tenant = Tenant::create();
|
||||
Artisan::call('tenants:migrate');
|
||||
expect(Schema::hasTable('users'))->toBeFalse();
|
||||
|
||||
$tenant->run(function (){
|
||||
expect(DB::table('users')->count())->toBe(0);
|
||||
});
|
||||
|
||||
Artisan::call('tenants:seed', ['--class' => TestSeeder::class]);
|
||||
|
||||
$tenant->run(function (){
|
||||
$user = DB::table('users')->first();
|
||||
expect($user)->not()->toBeNull()
|
||||
->and($user->email)->toBe('seeded@user');
|
||||
$user = DB::table('users');
|
||||
expect($user->count())->toBe(1)
|
||||
->and($user->first()->email)->toBe('seeded@user');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue