1
0
Fork 0
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:
Samuel Štancl 2019-10-17 21:00:52 +02:00 committed by GitHub
parent d5b01219fd
commit cfcb2574c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 13 deletions

View file

@ -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