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

Fixed: make migration commands compatible

This commit is contained in:
Samuel Štancl 2022-03-30 16:49:01 +02:00
parent f04d4cd80f
commit a63906f3fd
4 changed files with 44 additions and 20 deletions

View file

@ -4,6 +4,7 @@ declare(strict_types=1);
namespace Stancl\Tenancy\Tests;
use Closure;
use Exception;
use Illuminate\Support\Str;
use Illuminate\Bus\Queueable;
@ -24,6 +25,7 @@ use Illuminate\Queue\Events\JobProcessed;
use Illuminate\Queue\Events\JobProcessing;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use PDO;
use Stancl\Tenancy\Events\TenancyInitialized;
use Stancl\Tenancy\Listeners\BootstrapTenancy;
use Stancl\Tenancy\Listeners\RevertToCentralContext;
@ -52,7 +54,7 @@ class QueueTest extends TestCase
Event::listen(TenancyInitialized::class, BootstrapTenancy::class);
Event::listen(TenancyEnded::class, RevertToCentralContext::class);
$this->valuestore = Valuestore::make(__DIR__ . '/Etc/tmp/queuetest.json')->flush();
$this->createValueStore();
}
public function tearDown(): void
@ -60,6 +62,17 @@ class QueueTest extends TestCase
$this->valuestore->flush();
}
protected function createValueStore(): void
{
$valueStorePath = __DIR__ . '/Etc/tmp/queuetest.json';
if (! file_exists($valueStorePath)) {
file_put_contents($valueStorePath, '');
}
$this->valuestore = Valuestore::make($valueStorePath)->flush();
}
protected function withFailedJobs()
{
Schema::connection('central')->create('failed_jobs', function (Blueprint $table) {