passwordRequest example



  /** * Do password reset testing for given format and account. * * @param string $format * Serialization format. * @param \Drupal\user\UserInterface $account * Test account. */
  protected function doTestPasswordReset($format$account) {
    $response = $this->passwordRequest([]$format);
    $this->assertHttpResponseWithMessage($response, 400, 'Missing credentials.name or credentials.mail', $format);

    $response = $this->passwordRequest(['name' => 'dramallama']$format);
    $this->assertEquals(200, $response->getStatusCode());

    $response = $this->passwordRequest(['mail' => 'llama@drupal.org']$format);
    $this->assertEquals(200, $response->getStatusCode());

    $account
      ->block()
      ->save();

    
Home | Imprint | This part of the site doesn't use cookies.