runApiTests($api, $params); } public function getApiForTesting() { $apiToCall = ['CustomVariables.getCustomVariables', 'Live.getLastVisitsDetails']; $xmlFieldsToRemove = []; if (version_compare(Version::VERSION, '4.12.0-rc1', '<')) { // those fields have been added to goal details $xmlFieldsToRemove = [ 'referrerType', 'referrerName', 'referrerKeyword', ]; } if (version_compare(Version::VERSION, '5.5.0-b1', '<')) { // In Matomo 5.5 ai referrer had been added $xmlFieldsToRemove = array_merge($xmlFieldsToRemove, ['referrerAIAssistantUrl', 'referrerAIAssistantIcon']); } return [ [ $apiToCall, [ 'idSite' => self::$fixture->idSite, 'date' => self::$fixture->dateTime, 'periods' => ['day'], 'xmlFieldsToRemove' => $xmlFieldsToRemove, ], ], ]; } /** * Path where expected/processed output files are stored. */ public static function getPathToTestDirectory() { return __DIR__; } } CustomVariablesSystemTest::$fixture = new VisitWithManyCustomVariables();