diff options
author | AltamashShaikh <altamash@innocraft.com> | 2021-12-16 23:57:46 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-16 23:57:46 +0300 |
commit | 9fa38fe3cc31632e2a6a0e916c5df7185c872e0d (patch) | |
tree | 05241bbde2d54d6f3a2770fd073d7405977661a6 /tests/PHPUnit/Framework | |
parent | 81d6a44dc2b5e611bb2039a1e9ceafb22b1722b5 (diff) |
Filter metdata api response only when the test is executed for allowed metadata API (#18510)
Diffstat (limited to 'tests/PHPUnit/Framework')
-rw-r--r-- | tests/PHPUnit/Framework/TestCase/SystemTestCase.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/PHPUnit/Framework/TestCase/SystemTestCase.php b/tests/PHPUnit/Framework/TestCase/SystemTestCase.php index 65b0d83880..0dcbf83e03 100644 --- a/tests/PHPUnit/Framework/TestCase/SystemTestCase.php +++ b/tests/PHPUnit/Framework/TestCase/SystemTestCase.php @@ -81,6 +81,8 @@ abstract class SystemTestCase extends TestCase ), ); + private static $shouldFilterApiResponse = false; + public function setGroups(array $groups): void { $pluginName = explode('\\', get_class($this)); @@ -131,7 +133,7 @@ abstract class SystemTestCase extends TestCase } else if ($apiValue['filterKey'] === 'category') { $filterValues = self::getAllowedCategoriesToFilterApiResponse($api); } - if ($filterValues) { + if ($filterValues && self::$shouldFilterApiResponse) { self::filterReportsCallback($reports, $info, $api, $apiValue['filterKey'], $filterValues); } }); @@ -495,6 +497,10 @@ abstract class SystemTestCase extends TestCase $onlyCheckUnserialize = !empty($params['onlyCheckUnserialize']); + $apiIdExploded = explode('_', str_replace('.xml', '', $apiId)); + $api = $apiIdExploded[0]; + self::$shouldFilterApiResponse = !empty(self::$apisToFilterResponse[$api]); + $processedResponse = Response::loadFromApi($params, $requestUrl, $normailze = !$onlyCheckUnserialize); if (empty($compareAgainst)) { $processedResponse->save($processedFilePath); |