@@ -116,8 +116,8 @@ public static function dataProviderReportFilters(): array
116116 return [
117117 [[], 6 ],
118118 [['filter_campaign[0] ' => 'functional ' ], 2 ],
119- [['filter_platform ' => 'chromium ' ], 3 ],
120- [['filter_browser ' => 'chromium ' ], 3 ],
119+ [['filter_platform ' => 'chromium ' ], 4 ],
120+ [['filter_browser ' => 'chromium ' ], 4 ],
121121 [['filter_version ' => 'develop ' ], 6 ],
122122 ];
123123 }
@@ -149,10 +149,15 @@ public function testCorsReportID(): void
149149 $ this ->assertEquals ($ response ->headers ->get ('access-control-allow-origin ' ), '* ' );
150150 }
151151
152- public function testReportID (): void
152+ /**
153+ * @dataProvider dataProviderReportID
154+ *
155+ * @param array<string> $campaigns
156+ */
157+ public function testReportID (int $ reportId , array $ campaigns ): void
153158 {
154159 $ client = static ::createClient ();
155- $ client ->request ('GET ' , '/reports/2 ' );
160+ $ client ->request ('GET ' , '/reports/ ' . $ reportId );
156161 $ response = $ client ->getResponse ();
157162
158163 $ this ->assertEquals (200 , $ response ->getStatusCode ());
@@ -167,7 +172,7 @@ public function testReportID(): void
167172 $ this ->assertArrayHasKey ('date ' , $ content );
168173 $ this ->assertArrayHasKey ('version ' , $ content );
169174 $ this ->assertArrayHasKey ('campaign ' , $ content );
170- $ this ->assertContains ($ content ['campaign ' ], ReportMochaImporter:: FILTER_CAMPAIGNS );
175+ $ this ->assertContains ($ content ['campaign ' ], $ campaigns );
171176 $ this ->assertArrayHasKey ('browser ' , $ content );
172177 $ this ->assertContains ($ content ['browser ' ], ReportMochaImporter::FILTER_PLATFORMS );
173178 $ this ->assertArrayHasKey ('platform ' , $ content );
@@ -195,11 +200,27 @@ public function testReportID(): void
195200
196201 $ this ->assertArrayHasKey ('suites_data ' , $ content );
197202 $ this ->assertIsArray ($ content ['suites_data ' ]);
203+ $ this ->assertNotEmpty ($ content ['suites_data ' ]);
198204 foreach ($ content ['suites_data ' ] as $ suiteId => $ suiteItem ) {
199205 $ this ->partialTestSuite ($ content ['id ' ], $ suiteId , $ suiteItem , null , true );
200206 }
201207 }
202208
209+ /**
210+ * @return array<array<int>>
211+ */
212+ public static function dataProviderReportID (): array
213+ {
214+ return [
215+ // autoupgrade
216+ [1 , ReportMochaImporter::FILTER_CAMPAIGNS ],
217+ // functional
218+ [2 , ReportMochaImporter::FILTER_CAMPAIGNS ],
219+ // blockwishlist
220+ [3 , ReportPlaywrightImporter::FILTER_CAMPAIGNS ],
221+ ];
222+ }
223+
203224 public function testReportIDSuiteID (): void
204225 {
205226 $ client = static ::createClient ();
0 commit comments