Skip to content

Commit

Permalink
OPENEUROPA-1501: Rename constant and add string for path in behat.
Browse files Browse the repository at this point in the history
  • Loading branch information
nagyad committed Jan 11, 2019
1 parent 930e50f commit 7d7ed6b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
5 changes: 4 additions & 1 deletion behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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: ~
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 7 additions & 7 deletions src/Form/AuthenticationSettingsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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);
}
Expand All @@ -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'))
Expand Down
2 changes: 1 addition & 1 deletion tests/features/configure_authentication.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 7d7ed6b

Please sign in to comment.