From cc85b43e131104457b055495433d1fe24bd00f26 Mon Sep 17 00:00:00 2001 From: Stefan Giehl Date: Fri, 10 May 2024 10:28:49 +0200 Subject: [PATCH] Improve stability of Tracker\RequestSetTest (#22200) --- tests/PHPUnit/Unit/Tracker/RequestSetTest.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/PHPUnit/Unit/Tracker/RequestSetTest.php b/tests/PHPUnit/Unit/Tracker/RequestSetTest.php index f38b1debf50..17dd7a18fe0 100644 --- a/tests/PHPUnit/Unit/Tracker/RequestSetTest.php +++ b/tests/PHPUnit/Unit/Tracker/RequestSetTest.php @@ -116,18 +116,22 @@ public function testSetRequestsShouldConvertNonRequestInstancesToARequestInstanc public function testSetRequestsShouldIgnoreEmptyRequestsButNotArrays() { - $requests = array( - $this->buildRequest(5), + $request1 = $this->buildRequest(5); + $request2 = $this->buildRequest(2); + $request3 = $this->buildRequest(6); + + $requests = [ + $request1, null, - $this->buildRequest(2), + $request2, 0, - $this->buildRequest(6), - array() - ); + $request3, + [] + ]; $this->requestSet->setRequests($requests); - $expected = array($this->buildRequest(5), $this->buildRequest(2), $this->buildRequest(6), new Request(array())); + $expected = [$request1, $request2, $request3, new Request([])]; $this->assertEquals($expected, $this->requestSet->getRequests()); }