Skip to content

Commit

Permalink
Fixes for lower version of test to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
AltamashShaikh committed Jul 11, 2024
1 parent 23dc1cf commit d92d5be
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tests/System/ImportTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public function testApi($api, $params)
if (version_compare(Version::VERSION, '4.10.0') <= 0) {
$this->markTestSkipped('Skipping tests for lower version');
}
if ($api === 'Goals.get' && version_compare(Version::VERSION, '5.2.0-alpha', '<')) {
$this->markTestSkipped('Skipping tests for lower version');
}
$this->runApiTests($api, $params);
}
public function getApiTestsToRun()
Expand All @@ -59,14 +62,9 @@ public function getApiTestsToRun()
$apiNotToTest[] = 'CustomDimensions.getConfiguredCustomDimensions';
}

$secondaryApiNotToTest = [];
if (version_compare(Version::VERSION, '5.2.0-alpha', '<')) {
$secondaryApiNotToTest[] = 'Goals.get';
}

return [
[$apiToTest, ['idSite' => self::$fixture->idSite, 'date' => self::$fixture->dateTime, 'periods' => ['day', 'week', 'month', 'year'], 'apiNotToCall' => $apiNotToTest]],
[$secondaryApiToTest, ['idSite' => self::$fixture->idSite, 'date' => self::$fixture->dateTime, 'periods' => ['day', 'week', 'month'], 'apiNotToCall' => $secondaryApiNotToTest]],
[$secondaryApiToTest, ['idSite' => self::$fixture->idSite, 'date' => self::$fixture->dateTime, 'periods' => ['day', 'week', 'month']]],
[array_merge($secondaryApiToTest, ['Goals.getGoals']), ['idSite' => self::$fixture->idSite, 'date' => self::$fixture->dateTime, 'periods' => ['year'], 'testSuffix' => version_compare(Version::VERSION, '5.0.0-b1', '<=') ? '_5b1' : '']],
[['Goals.getDaysToConversion', 'Goals.getVisitsUntilConversion'], ['idSite' => self::$fixture->idSite, 'date' => self::$fixture->dateTime, 'periods' => ['day', 'week', 'month', 'year'], 'idGoal' => 'ecommerceOrder', 'testSuffix' => '_ecommerceOrder']],
// custom dimensions
Expand Down

0 comments on commit d92d5be

Please sign in to comment.