assertTrue($report->supportsFlatten(), $apiAction); $this->assertFalse($view->config->show_flatten_table, $apiAction); $this->assertTrue($view->config->report_supports_flatten, $apiAction); $this->assertFalse($view->config->show_flatten_table_export, $apiAction); } public function testViewFactoryKeepsFlattenExportEnabledForReportsThatSupportFlattening(): void { $view = ViewDataTableFactory::build( $defaultType = null, 'Actions.getPageUrls', $controllerAction = 'Actions.getPageUrls', $forceDefault = false, $loadViewDataTableParametersForUser = false ); $this->assertTrue($view->config->show_flatten_table); $this->assertTrue($view->config->report_supports_flatten); $this->assertTrue($view->config->show_flatten_table_export); } public function testViewFactoryDisablesFlattenUiAndExportForReportsThatDoNotSupportFlattening(): void { $view = ViewDataTableFactory::build( $defaultType = null, 'Referrers.getReferrerType', $controllerAction = 'Referrers.getReferrerType', $forceDefault = false, $loadViewDataTableParametersForUser = false ); $this->assertFalse($view->config->show_flatten_table); $this->assertFalse($view->config->report_supports_flatten); $this->assertFalse($view->config->show_flatten_table_export); } public function provideReportsThatHideFlattenInTheUi(): iterable { yield ['UserLanguage.getLanguage']; yield ['VisitTime.getVisitInformationPerLocalTime']; yield ['VisitTime.getVisitInformationPerServerTime']; yield ['DevicesDetection.getOsVersions']; yield ['DevicesDetection.getBrowsers']; yield ['DevicesDetection.getType']; yield ['DevicePlugins.getPlugin']; yield ['Resolution.getConfiguration']; yield ['UserCountry.getCountry']; yield ['UserCountry.getContinent']; yield ['UserCountry.getCity']; yield ['UserCountry.getRegion']; } }