setHideIgnoredFunctions(false); } public function tearDown(): void { parent::tearDown(); // reset that value after the test Proxy::getInstance()->setHideIgnoredFunctions(true); } public static function getOutputPrefix() { return 'apiGetReportMetadata'; } public function getApiForTesting() { $idSite = self::$fixture->idSite; $dateTime = self::$fixture->dateTime; return [ ['API', ['idSite' => $idSite, 'date' => $dateTime]], // test w/ hideMetricsDocs=true [ 'API.getMetadata', [ 'idSite' => $idSite, 'date' => $dateTime, 'apiModule' => 'Actions', 'apiAction' => 'get', 'testSuffix' => '_hideMetricsDoc', 'otherRequestParameters' => ['hideMetricsDoc' => 1], ], ], [ 'API.getProcessedReport', [ 'idSite' => $idSite, 'date' => $dateTime, 'apiModule' => 'Actions', 'apiAction' => 'get', 'testSuffix' => '_hideMetricsDoc', 'otherRequestParameters' => ['hideMetricsDoc' => 1], ], ], // Test w/ showRawMetrics=true [ 'API.getProcessedReport', [ 'idSite' => $idSite, 'date' => $dateTime, 'apiModule' => 'UserCountry', 'apiAction' => 'getCountry', 'testSuffix' => '_showRawMetrics', 'otherRequestParameters' => ['showRawMetrics' => 1], ], ], // Test w/ showRawMetrics=true [ 'Actions.getPageTitles', [ 'idSite' => $idSite, 'date' => $dateTime, 'testSuffix' => '_pageTitleZeroString', ], ], // Test w/ no format, should default to format=json [ 'Actions.getPageTitles', [ 'idSite' => $idSite, 'date' => $dateTime, 'testSuffix' => '_defaultFormatValue', 'format' => 'asldjkf', ], ], ]; } /** * @dataProvider getApiForTesting */ public function testApi($api, $params) { $this->runApiTests($api, $params); } } ApiGetReportMetadataTest::$fixture = new ThreeGoalsOnePageview();