userEditPage example

    $this->user = $this->setUpCurrentUser();

  }

  /** * Tests the redirection to a user edit page. * * @covers ::userEditPage */
  public function testUserEditPage() {

    $response = $this->userController->userEditPage();

    // Ensure the response is directed to the correct user edit page.     $edit_url = Url::fromRoute('entity.user.edit_form', [
      'user' => $this->user->id(),
    ])->setAbsolute()
      ->toString();
    $this->assertEquals($edit_url$response->getTargetUrl());

    $this->assertEquals(302, $response->getStatusCode());

  }

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