diff --git a/tests/BatchTest.php b/tests/BatchTest.php index a401dbc7..a168deb2 100644 --- a/tests/BatchTest.php +++ b/tests/BatchTest.php @@ -24,15 +24,17 @@ beforeEach(function () { test('batch repository is set to tenant connection and reverted', function () { $tenant = Tenant::create(); + $tenant2 = Tenant::create(); expect(getBatchRepositoryConnectionName())->toBe('central'); tenancy()->initialize($tenant); - + expect(getBatchRepositoryConnectionName())->toBe('tenant'); + + tenancy()->initialize($tenant2); expect(getBatchRepositoryConnectionName())->toBe('tenant'); tenancy()->end(); - expect(getBatchRepositoryConnectionName())->toBe('central'); })->skip(fn() => version_compare(app()->version(), '8.0', '<'), 'Job batches are only supported in Laravel 8+');