Skip to content

Commit

Permalink
Issue #83: After Behat config revert the router should be rebuild.
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiu-cristea committed Jun 4, 2019
1 parent fcebdcc commit 415525e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/Behat/AuthenticationContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,27 @@ public function backupCasConfigs(): void {
}
}

/**
* Act after reverting the config.
*
* Some tests are changing the oe_authentication:redirect_user_register_route
* config value. Changing this value, requires router rebuilding. This is
* covered in UI, see AuthenticationSettingsForm::submitForm(). But, after
* running the tests, the oe_authentication configuration is reverted to its
* initial values, in ConfigContext::cleanConfig(). This time the UI is not
* used anymore, so we need to do it after the scenario. Note that the hooks
* of AuthenticationContext are always running after ConfigContext hooks, so
* the router rebuild will run after reverting the config.
*
* @see \Drupal\oe_authentication\Form\AuthenticationSettingsForm::submitForm()
* @see \Drupal\DrupalExtension\Context\ConfigContext::cleanConfig()
*
* @AfterScenario @RebuildRouter
*/
public function rebuildRoutes(): void {
\Drupal::service('router.builder')->rebuild();
}

/**
* Navigates to the current user's page.
*
Expand Down

0 comments on commit 415525e

Please sign in to comment.