From f7b0ee9ebbe424f3704269cee81ea67f3b075e90 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Wed, 27 Dec 2023 17:46:13 +0100 Subject: [PATCH] Fix random test --- tests/Unit/Controllers/ShiftsControllerTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Unit/Controllers/ShiftsControllerTest.php b/tests/Unit/Controllers/ShiftsControllerTest.php index 3f5baf40..336f9888 100644 --- a/tests/Unit/Controllers/ShiftsControllerTest.php +++ b/tests/Unit/Controllers/ShiftsControllerTest.php @@ -90,10 +90,10 @@ class ShiftsControllerTest extends ControllerTest $this->redirect->expects($this->exactly(10)) ->method('to') ->willReturnCallback(function (string $url) use ($possibleShift1, $possibleShift2) { - parse_str(parse_url($url)['query'], $parameters); + parse_str(parse_url($url)['query'] ?? '', $parameters); $this->assertTrue(Str::startsWith($url, 'http://localhost/shifts')); $this->assertArrayHasKey('shift_id', $parameters); - $shiftId = $parameters['shift_id']; + $shiftId = $parameters['shift_id'] ?? 0; $this->assertTrue(in_array($shiftId, [$possibleShift1->id, $possibleShift2->id])); return $this->response; });