mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 15:34:04 +00:00
Central queues
This commit is contained in:
parent
58fbdd5281
commit
2641fae3a3
2 changed files with 25 additions and 3 deletions
|
|
@ -33,6 +33,24 @@ class QueueTest extends TestCase
|
|||
return $event->job->payload()['tenant_id'] === tenant('id');
|
||||
});
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function tenancy_is_not_initialized_in_non_tenant_queues()
|
||||
{
|
||||
$this->loadLaravelMigrations(['--database' => 'tenant']);
|
||||
Event::fake();
|
||||
|
||||
config(['queue.connections.central' => [
|
||||
'driver' => 'sync',
|
||||
'tenancy' => false,
|
||||
]]);
|
||||
|
||||
dispatch(new TestJob())->onConnection('central');
|
||||
|
||||
Event::assertDispatched(JobProcessing::class, function ($event) {
|
||||
return ! isset($event->job->payload()['tenant_id']);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class TestJob implements ShouldQueue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue