mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 09:34:04 +00:00
[2.1.0] Central queue connections (#181)
* Central queues * Better dependency injection * tenancy=false => central=true; move config to env setup * Apply fixes from StyleCI
This commit is contained in:
parent
d5b01219fd
commit
cfcb2574c2
4 changed files with 34 additions and 13 deletions
|
|
@ -33,6 +33,19 @@ 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();
|
||||
|
||||
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