From 2d3bc725d9af98209c4fbbb1c2f7b166469a51a6 Mon Sep 17 00:00:00 2001 From: sgiehl Date: Wed, 8 May 2024 15:23:13 +0200 Subject: [PATCH] Improve stability of Tracker\RequestSetTest --- 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()); }