1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-06 00:04:03 +00:00

Automigration test, config key, QueueTenancyBootstrapper support for QueueFake

This commit is contained in:
Samuel Štancl 2019-10-04 21:09:19 +02:00
parent be02f22484
commit 1df2b9d66d
3 changed files with 29 additions and 3 deletions

View file

@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Stancl\Tenancy\TenancyBootstrappers;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Support\Testing\Fakes\QueueFake;
use Stancl\Tenancy\Contracts\TenancyBootstrapper;
use Stancl\Tenancy\Tenant;
@ -21,9 +22,11 @@ class QueueTenancyBootstrapper implements TenancyBootstrapper
$this->app = $app;
$bootstrapper = &$this;
$this->app['queue']->createPayloadUsing(function () use (&$bootstrapper) {
return $bootstrapper->getPayload();
});
if (! $queue = $this->app['queue'] instanceof QueueFake) {
$queue->createPayloadUsing(function () use (&$bootstrapper) {
return $bootstrapper->getPayload();
});
}
}
public function start(Tenant $tenant)