mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 23:44: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 (){
|
test('seed command works', function (){
|
||||||
$tenant = Tenant::create();
|
$tenant = Tenant::create();
|
||||||
Artisan::call('tenants:migrate');
|
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]);
|
Artisan::call('tenants:seed', ['--class' => TestSeeder::class]);
|
||||||
|
|
||||||
$tenant->run(function (){
|
$tenant->run(function (){
|
||||||
$user = DB::table('users')->first();
|
$user = DB::table('users');
|
||||||
expect($user)->not()->toBeNull()
|
expect($user->count())->toBe(1)
|
||||||
->and($user->email)->toBe('seeded@user');
|
->and($user->first()->email)->toBe('seeded@user');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue