public function SocialMinkContext::iSetAlias in Open Social 10.3.x
Same name and namespace in other branches
- 8.9 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iSetAlias()
- 8.6 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iSetAlias()
- 8.7 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iSetAlias()
- 8.8 tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iSetAlias()
- 10.0.x tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iSetAlias()
- 10.1.x tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iSetAlias()
- 10.2.x tests/behat/features/bootstrap/SocialMinkContext.php \Drupal\social\Behat\SocialMinkContext::iSetAlias()
Set alias field as specified value Example: When I set alias as: "bwayne"
@When /^(?:|I )set alias as "(?P<value>(?:[^"]|\\")*)"$/
File
- tests/
behat/ features/ bootstrap/ SocialMinkContext.php, line 202
Class
- SocialMinkContext
- Defines application features from the specific context.
Namespace
Drupal\social\BehatCode
public function iSetAlias($value) {
// Uncheck "Generate automatic URL alias" if social_path_manager is enabled.
if (\Drupal::service('module_handler')
->moduleExists('social_path_manager')) {
$option = $this
->fixStepArgument('Generate automatic URL alias');
$this
->getSession()
->getPage()
->uncheckField($option);
}
// Fill in "URL alias" field with given value
$field = $this
->fixStepArgument('path[0][alias]');
$value = $this
->fixStepArgument($value);
$this
->getSession()
->getPage()
->fillField($field, $value);
}