public function assertAuthenticatedByUsernameAndPassword($name, $password) {
    $user = (object) [
      'name' => $name,
      'pass' => $password,
    ];
    $this->userCreate($user);
    $this->login($user);
  }
public function assertAuthenticatedByUsernameAndPassword($name, $password) {
    $user = (object) [
      'name' => $name,
      'pass' => $password,
    ];
    $this->userCreate($user);
    $this->login($user);
  }
public function assertAuthenticatedByUsernameAndPassword ( $ name , $ password ) { $ user = ( object ) [ 'name' => $ name , 'pass' => $ password , ] ; $ this -> userCreate ( $ user ) ; $ this -> login ( $ user ) ; }
Creates and authenticates a user with the given username and password.

In Drupal 8 it is possible to register a user without an e-mail address,
using only a username and password.

This step definition is intended to test if users that are registered in
one context (in this case FeatureContext) can be accessed in other
contexts.

See the scenario 'Logging in as a user without an e-mail address' in
d8.feature.

@Given I am logged in as a user with name :name and password :password
Creates and authenticates a user with the given username and password .