mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 11:14:04 +00:00
Merge hotfix branch (#834)
* try specifying the signature in __construct * constructor doesn't work since Reflection is used, try specifying getDefaultName() instead * Fixed: make migration commands compatible * Fix failing tests * Fix username generation * Re-create tmp dir as well if needed * wip
This commit is contained in:
parent
4f19609797
commit
349125c02e
10 changed files with 75 additions and 27 deletions
|
|
@ -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,22 @@ class QueueTest extends TestCase
|
|||
$this->valuestore->flush();
|
||||
}
|
||||
|
||||
protected function createValueStore(): void
|
||||
{
|
||||
$valueStorePath = __DIR__ . '/Etc/tmp/queuetest.json';
|
||||
|
||||
if (! file_exists($valueStorePath)) {
|
||||
// The directory sometimes goes missing as well when the file is deleted in git
|
||||
if (! is_dir(__DIR__ . '/Etc/tmp')) {
|
||||
mkdir(__DIR__ . '/Etc/tmp');
|
||||
}
|
||||
|
||||
file_put_contents($valueStorePath, '');
|
||||
}
|
||||
|
||||
$this->valuestore = Valuestore::make($valueStorePath)->flush();
|
||||
}
|
||||
|
||||
protected function withFailedJobs()
|
||||
{
|
||||
Schema::connection('central')->create('failed_jobs', function (Blueprint $table) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue