Skip to content

Commit

Permalink
OPENEUROPA-1500: Backup analytics configs for behat and fix test.
Browse files Browse the repository at this point in the history
  • Loading branch information
nagyad committed Jan 9, 2019
1 parent a5716ca commit 3230356
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
13 changes: 13 additions & 0 deletions tests/Behat/WebtoolsAnalyticsConfigContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,17 @@ public function webtoolsAnalyicsConfigIsSet(string $id, string $sitepath): void
$this->setConfig('oe_webtools_analytics.settings', 'sitePath', $sitepath);
}

/**
* Backup configs that need to be reverted in AfterScenario by ConfigContext.
*
* @BeforeScenario @BackupAnalyticsConfigs
*/
public function backupAnalyticsConfigs() {
$name = 'oe_webtools_analytics.settings';
$configs = $this->getDriver()->getCore()->configGet($name);
foreach ($configs as $key => $backup) {
$this->config[$name][$key] = $backup;
}
}

}
3 changes: 2 additions & 1 deletion tests/features/analytics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ Feature: Webtools Analytics
I need to be able to configure the settings

Background:
Given I am logged in as a user with the "administer site configuration" permission
Given I am logged in as a user with the "administer webtools analytics" permission

@BackupAnalyticsConfigs
Scenario: Create Webtools Analytics settings
Given I am on "admin/config/system/oe_webtools_analytics"
Then I should see "Webtools Analytics settings"
Expand Down

0 comments on commit 3230356

Please sign in to comment.