diff --git a/tests/TaskHandlerTest.php b/tests/TaskHandlerTest.php index 988c498..cb058fa 100644 --- a/tests/TaskHandlerTest.php +++ b/tests/TaskHandlerTest.php @@ -2,7 +2,7 @@ namespace Tests; -use Illuminate\Console\Application as ConsoleApplication; +use Illuminate\Console\Scheduling\Schedule; use Illuminate\Support\Facades\Event; use PHPUnit\Framework\Attributes\Test; use Stackkit\LaravelGoogleCloudScheduler\OpenIdVerificator; @@ -62,9 +62,7 @@ public function it_prevents_overlapping_if_the_command_is_scheduled_without_over $this->assertLoggedLines(1); $this->assertLogged('TestCommand'); - $expression = '* * * * *'; - $command = ConsoleApplication::formatCommandString('test:command'); - $mutex = 'framework'.DIRECTORY_SEPARATOR.'schedule-'.sha1($expression.$command); + $mutex = head(app(Schedule::class)->events())->mutexName(); cache()->add($mutex, true, 60);