Skip to content

Commit

Permalink
OPENEUROPA-1500: Name path for behat.
Browse files Browse the repository at this point in the history
  • Loading branch information
nagyad committed Jan 11, 2019
1 parent 8a0d469 commit 04f742d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -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: ~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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.'),
];

Expand All @@ -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'))
Expand Down
2 changes: 1 addition & 1 deletion tests/features/analytics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 04f742d

Please sign in to comment.