public function FeatureContext::openProfileOf in Open Social 8.4
Same name and namespace in other branches
- 8.9 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::openProfileOf()
- 8.3 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::openProfileOf()
- 8.5 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::openProfileOf()
- 8.6 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::openProfileOf()
- 8.7 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::openProfileOf()
- 8.8 tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::openProfileOf()
- 10.3.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::openProfileOf()
- 10.0.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::openProfileOf()
- 10.1.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::openProfileOf()
- 10.2.x tests/behat/features/bootstrap/FeatureContext.php \Drupal\social\Behat\FeatureContext::openProfileOf()
Opens specified page.
@Given /^(?:|I )am on the profile of "(?P<username>[^"]+)"$/ @When /^(?:|I )go to the profile of "(?P<username>[^"]+)"$/
File
- tests/
behat/ features/ bootstrap/ FeatureContext.php, line 434
Class
- FeatureContext
- Defines application features from the specific context.
Namespace
Drupal\social\BehatCode
public function openProfileOf($username) {
$account = user_load_by_name($username);
if ($account
->id() !== 0) {
$account_uid = $account
->id();
}
else {
throw new \Exception(sprintf("User with username '%s' does not exist.", $username));
}
$page = '/user/' . $account_uid;
$this
->visitPath($page);
}