diff --git a/behat.yml.dist b/behat.yml.dist index 8be9f0b..a07eaa8 100644 --- a/behat.yml.dist +++ b/behat.yml.dist @@ -4,11 +4,14 @@ default: paths: - %paths.base%/tests/features contexts: - - Drupal\DrupalExtension\Context\MinkContext - Drupal\DrupalExtension\Context\ConfigContext - Drupal\DrupalExtension\Context\DrupalContext - Drupal\DrupalExtension\Context\MessageContext + - Drupal\DrupalExtension\Context\MinkContext - Drupal\Tests\oe_authentication\Behat\AuthenticationContext + - OpenEuropa\Behat\TransformationContext: + pages: + Authentication configuration: 'admin/config/system/oe_authentication' extensions: Behat\MinkExtension: goutte: ~ diff --git a/composer.json b/composer.json index c8e69f8..95a16e9 100644 --- a/composer.json +++ b/composer.json @@ -19,6 +19,7 @@ "drupal/drupal-extension": "~4.0", "drush/drush": "~9.0@stable", "nikic/php-parser": "~3.0", + "openeuropa/behat-transformation-context" : "~0.1", "openeuropa/code-review": "~1.0.0-alpha4", "openeuropa/drupal-core-require-dev": "^8.6", "openeuropa/task-runner": "~1.0-beta4", diff --git a/src/Form/AuthenticationSettingsForm.php b/src/Form/AuthenticationSettingsForm.php index 6b3ee4b..1e70289 100644 --- a/src/Form/AuthenticationSettingsForm.php +++ b/src/Form/AuthenticationSettingsForm.php @@ -15,7 +15,7 @@ class AuthenticationSettingsForm extends ConfigFormBase { /** * Name of the config being edited. */ - const CONFIGNAME = 'oe_authentication.settings'; + const CONFIG_NAME = 'oe_authentication.settings'; /** * {@inheritdoc} @@ -31,27 +31,27 @@ public function buildForm(array $form, FormStateInterface $form_state) { $form['protocol'] = [ '#type' => 'textfield', '#title' => $this->t('Application authentication protocol'), - '#default_value' => $this->config(static::CONFIGNAME)->get('protocol'), + '#default_value' => $this->config(static::CONFIG_NAME)->get('protocol'), ]; $form['register_path'] = [ '#type' => 'textfield', '#title' => $this->t('Application register path'), - '#default_value' => $this->config(static::CONFIGNAME)->get('register_path'), + '#default_value' => $this->config(static::CONFIG_NAME)->get('register_path'), ]; $form['validation_path'] = [ '#type' => 'textfield', '#title' => $this->t('Application validation path'), - '#default_value' => $this->config(static::CONFIGNAME)->get('validation_path'), + '#default_value' => $this->config(static::CONFIG_NAME)->get('validation_path'), ]; $form['assurance_level'] = [ '#type' => 'textfield', '#title' => $this->t('Application assurance levels'), - '#default_value' => $this->config(static::CONFIGNAME)->get('assurance_level'), + '#default_value' => $this->config(static::CONFIG_NAME)->get('assurance_level'), ]; $form['ticket_types'] = [ '#type' => 'textfield', '#title' => $this->t('Application available ticket types'), - '#default_value' => $this->config(static::CONFIGNAME)->get('ticket_types'), + '#default_value' => $this->config(static::CONFIG_NAME)->get('ticket_types'), ]; return parent::buildForm($form, $form_state); } @@ -60,7 +60,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('protocol', $form_state->getValue('protocol')) ->set('register_path', $form_state->getValue('register_path')) ->set('validation_path', $form_state->getValue('validation_path')) diff --git a/tests/features/configure_authentication.feature b/tests/features/configure_authentication.feature index 5622230..b1bc885 100644 --- a/tests/features/configure_authentication.feature +++ b/tests/features/configure_authentication.feature @@ -8,7 +8,7 @@ Feature: Authentication @DrupalLogin @BackupAuthConfigs Scenario: Configure Authentication settings - Given I am on "admin/config/system/oe_authentication" + Given I am on "the Authentication configuration page" Then I should see "Authentication settings" # Check for the default config is there. And the "Application authentication protocol" field should contain "eulogin"