webCronToken(); $this->assertSame(40, strlen($token)); $this->get('/cron/falsch')->assertNotFound(); $this->get("/cron/{$token}")->assertNoContent(); $this->assertArrayHasKey('webcron', app(BackgroundTasks::class)->heartbeats()); } public function test_pseudo_cron_only_steps_in_without_external_cron(): void { $tasks = app(BackgroundTasks::class); $this->assertTrue($tasks->pseudoCronDue()); $tasks->heartbeat('cron'); $this->assertFalse($tasks->pseudoCronDue()); $this->travel(BackgroundTasks::PSEUDO_CRON_AFTER_SECONDS + 5)->seconds(); $this->assertTrue($tasks->pseudoCronDue()); $tasks->heartbeat('pseudo'); $this->assertFalse($tasks->pseudoCronDue(), 'Höchstens einmal pro Minute.'); } }