mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-04 10:42:23 +00:00
Jobs that v4.3.23 put in the queue have no type property. The promoted constructor property had no default, so these jobs failed with "must not be accessed before initialization" after the upgrade. - Declare type as a normal property with a null default
19 lines
627 B
PHP
19 lines
627 B
PHP
<?php
|
|
|
|
use App\Jobs\ScheduledJobManager;
|
|
use Illuminate\Queue\Middleware\WithoutOverlapping;
|
|
use Tests\TestCase;
|
|
|
|
uses(TestCase::class);
|
|
|
|
it('uses the shared lock for a job queued before scheduled job types existed', function () {
|
|
// v4.3.23 serialized ScheduledJobManager without a type property.
|
|
$job = unserialize('O:'.strlen(ScheduledJobManager::class).':"'.ScheduledJobManager::class.'":0:{}');
|
|
|
|
$middleware = $job->middleware();
|
|
|
|
expect($job->type)->toBeNull()
|
|
->and($middleware[0])->toBeInstanceOf(WithoutOverlapping::class)
|
|
->and($middleware[0]->key)->toBe('scheduled-job-manager');
|
|
});
|