diff --git a/behat.yml.dist b/behat.yml.dist index 5616e184..1f45b73f 100644 --- a/behat.yml.dist +++ b/behat.yml.dist @@ -10,6 +10,9 @@ default: - Drupal\DrupalExtension\Context\MessageContext - Drupal\Tests\oe_webtools\Behat\WebtoolsAnalyticsMinkContext - Drupal\Tests\oe_webtools\Behat\WebtoolsConfigContext + - OpenEuropa\Behat\TransformationContext: + pages: + Webtools Analytics configuration: '/admin/config/system/oe_webtools_analytics' extensions: Behat\MinkExtension: goutte: ~ diff --git a/modules/oe_webtools_analytics/src/Form/WebtoolsAnalyticsSettingsForm.php b/modules/oe_webtools_analytics/src/Form/WebtoolsAnalyticsSettingsForm.php index 719ad1ad..b3737081 100644 --- a/modules/oe_webtools_analytics/src/Form/WebtoolsAnalyticsSettingsForm.php +++ b/modules/oe_webtools_analytics/src/Form/WebtoolsAnalyticsSettingsForm.php @@ -15,7 +15,7 @@ class WebtoolsAnalyticsSettingsForm extends ConfigFormBase { /** * Name of the config being edited. */ - const CONFIGNAME = 'oe_webtools_analytics.settings'; + const CONFIG_NAME = 'oe_webtools_analytics.settings'; /** * {@inheritdoc} @@ -31,19 +31,19 @@ public function buildForm(array $form, FormStateInterface $form_state) { $form['siteID'] = [ '#type' => 'number', '#title' => $this->t('Site ID'), - '#default_value' => $this->config(static::CONFIGNAME)->get('siteID'), + '#default_value' => $this->config(static::CONFIG_NAME)->get('siteID'), '#description' => $this->t('The site unique numeric identifier.'), ]; $form['sitePath'] = [ '#type' => 'textfield', '#title' => $this->t('Site path'), - '#default_value' => $this->config(static::CONFIGNAME)->get('sitePath'), + '#default_value' => $this->config(static::CONFIG_NAME)->get('sitePath'), '#description' => $this->t('The domain + root path without protocol.'), ]; $form['instance'] = [ '#type' => 'textfield', '#title' => $this->t('Instance'), - '#default_value' => $this->config(static::CONFIGNAME)->get('instance'), + '#default_value' => $this->config(static::CONFIG_NAME)->get('instance'), '#description' => $this->t('The server instance. e.g. testing, ec.europa.eu or europa.eu.'), ]; @@ -54,7 +54,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { * {@inheritdoc} */ public function submitForm(array &$form, FormStateInterface $form_state) { - $this->config(static::CONFIGNAME) + $this->config(static::CONFIG_NAME) ->set('siteID', $form_state->getValue('siteID')) ->set('sitePath', $form_state->getValue('sitePath')) ->set('instance', $form_state->getValue('instance')) diff --git a/tests/features/analytics.feature b/tests/features/analytics.feature index 72fd63f5..a2a32cc8 100644 --- a/tests/features/analytics.feature +++ b/tests/features/analytics.feature @@ -7,7 +7,7 @@ Feature: Webtools Analytics @BackupAnalyticsConfigs Scenario: Create Webtools Analytics settings Given I am logged in as a user with the "administer webtools analytics" permission - And I am on "admin/config/system/oe_webtools_analytics" + And I am on "the Webtools Analytics configuration page" Then I should see "Webtools Analytics settings" When I fill in "Site ID" with "123456" And I fill in "Site path" with "ec.europa.eu/info"