Fix random test
This commit is contained in:
parent
0f794be25e
commit
f7b0ee9ebb
|
@ -90,10 +90,10 @@ class ShiftsControllerTest extends ControllerTest
|
||||||
$this->redirect->expects($this->exactly(10))
|
$this->redirect->expects($this->exactly(10))
|
||||||
->method('to')
|
->method('to')
|
||||||
->willReturnCallback(function (string $url) use ($possibleShift1, $possibleShift2) {
|
->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->assertTrue(Str::startsWith($url, 'http://localhost/shifts'));
|
||||||
$this->assertArrayHasKey('shift_id', $parameters);
|
$this->assertArrayHasKey('shift_id', $parameters);
|
||||||
$shiftId = $parameters['shift_id'];
|
$shiftId = $parameters['shift_id'] ?? 0;
|
||||||
$this->assertTrue(in_array($shiftId, [$possibleShift1->id, $possibleShift2->id]));
|
$this->assertTrue(in_array($shiftId, [$possibleShift1->id, $possibleShift2->id]));
|
||||||
return $this->response;
|
return $this->response;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue