@@ -102,6 +102,9 @@ protected function setUp(): void
102102 );
103103 }
104104
105+ /**
106+ * @SuppressWarnings(PHPMD.CyclomaticComplexity)
107+ */
105108 public function testGetCsvFile ()
106109 {
107110 $ componentName = 'component_name ' ;
@@ -142,7 +145,7 @@ public function testGetCsvFile()
142145 ->method ('getFields ' )
143146 ->with ($ this ->component )
144147 ->willReturn ([]);
145- $ this ->metadataProvider ->expects ($ this ->exactly ( 2 ))
148+ $ this ->metadataProvider ->expects ($ this ->any ( ))
146149 ->method ('getRowData ' )
147150 ->willReturnCallback (
148151 function ($ arg1 , $ arg2 , $ arg3 ) use ($ document1 , $ document2 , $ data ) {
@@ -153,7 +156,7 @@ function ($arg1, $arg2, $arg3) use ($document1, $document2, $data) {
153156 }
154157 }
155158 );
156- $ this ->metadataProvider ->expects ($ this ->exactly ( 2 ))
159+ $ this ->metadataProvider ->expects ($ this ->any ( ))
157160 ->method ('convertDate ' )
158161 ->willReturnCallback (
159162 function ($ arg1 , $ arg2 ) use ($ document1 , $ document2 , $ componentName ) {
@@ -245,25 +248,25 @@ private function mockComponent(string $componentName, array $page1Items, array $
245248 ->method ('getDataProvider ' )
246249 ->willReturn ($ dataProvider );
247250
248- $ dataProvider ->expects ($ this ->exactly (3 ))
251+ $ dataProvider ->expects ($ this ->exactly (2 ))
249252 ->method ('getSearchResult ' )
250253 ->willReturnOnConsecutiveCalls ($ searchResult0 , $ searchResult1 , $ searchResult2 );
251254
252255 $ dataProvider ->expects ($ this ->once ())
253256 ->method ('getSearchCriteria ' )
254257 ->willReturn ($ searchCriteria );
255258
256- $ searchResult1 ->expects ($ this ->once ())
259+ $ searchResult1 ->expects ($ this ->any ())
257260 ->method ('setTotalCount ' );
258261
259- $ searchResult2 ->expects ($ this ->once ())
262+ $ searchResult2 ->expects ($ this ->any ())
260263 ->method ('setTotalCount ' );
261264
262- $ searchResult1 ->expects ($ this ->once ())
265+ $ searchResult1 ->expects ($ this ->any ())
263266 ->method ('getItems ' )
264267 ->willReturn ($ page1Items );
265268
266- $ searchResult2 ->expects ($ this ->once ())
269+ $ searchResult2 ->expects ($ this ->any ())
267270 ->method ('getItems ' )
268271 ->willReturn ($ page2Items );
269272
0 commit comments