1
0
Fork 0
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:
Abrar Ahmad 2022-09-23 16:34:05 +05:00
parent 76e5777bc2
commit debde0a103

View file

@ -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');
});
});