@@ -102,6 +102,9 @@ protected function setUp(): void
102
102
);
103
103
}
104
104
105
+ /**
106
+ * @SuppressWarnings(PHPMD.CyclomaticComplexity)
107
+ */
105
108
public function testGetCsvFile ()
106
109
{
107
110
$ componentName = 'component_name ' ;
@@ -142,7 +145,7 @@ public function testGetCsvFile()
142
145
->method ('getFields ' )
143
146
->with ($ this ->component )
144
147
->willReturn ([]);
145
- $ this ->metadataProvider ->expects ($ this ->exactly ( 2 ))
148
+ $ this ->metadataProvider ->expects ($ this ->any ( ))
146
149
->method ('getRowData ' )
147
150
->willReturnCallback (
148
151
function ($ arg1 , $ arg2 , $ arg3 ) use ($ document1 , $ document2 , $ data ) {
@@ -153,7 +156,7 @@ function ($arg1, $arg2, $arg3) use ($document1, $document2, $data) {
153
156
}
154
157
}
155
158
);
156
- $ this ->metadataProvider ->expects ($ this ->exactly ( 2 ))
159
+ $ this ->metadataProvider ->expects ($ this ->any ( ))
157
160
->method ('convertDate ' )
158
161
->willReturnCallback (
159
162
function ($ arg1 , $ arg2 ) use ($ document1 , $ document2 , $ componentName ) {
@@ -245,25 +248,25 @@ private function mockComponent(string $componentName, array $page1Items, array $
245
248
->method ('getDataProvider ' )
246
249
->willReturn ($ dataProvider );
247
250
248
- $ dataProvider ->expects ($ this ->exactly (3 ))
251
+ $ dataProvider ->expects ($ this ->exactly (2 ))
249
252
->method ('getSearchResult ' )
250
253
->willReturnOnConsecutiveCalls ($ searchResult0 , $ searchResult1 , $ searchResult2 );
251
254
252
255
$ dataProvider ->expects ($ this ->once ())
253
256
->method ('getSearchCriteria ' )
254
257
->willReturn ($ searchCriteria );
255
258
256
- $ searchResult1 ->expects ($ this ->once ())
259
+ $ searchResult1 ->expects ($ this ->any ())
257
260
->method ('setTotalCount ' );
258
261
259
- $ searchResult2 ->expects ($ this ->once ())
262
+ $ searchResult2 ->expects ($ this ->any ())
260
263
->method ('setTotalCount ' );
261
264
262
- $ searchResult1 ->expects ($ this ->once ())
265
+ $ searchResult1 ->expects ($ this ->any ())
263
266
->method ('getItems ' )
264
267
->willReturn ($ page1Items );
265
268
266
- $ searchResult2 ->expects ($ this ->once ())
269
+ $ searchResult2 ->expects ($ this ->any ())
267
270
->method ('getItems ' )
268
271
->willReturn ($ page2Items );
269
272
0 commit comments