File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -28,17 +28,19 @@ public function userVisitProfile(string $name): void {
28
28
/**
29
29
* Visit edit page of the current user.
30
30
*
31
- * @When I go to my edit profile page
31
+ * @When I go to my profile edit page
32
32
*/
33
33
public function userVisitOwnProfile (): void {
34
- /** @var \Drupal\user\UserInterface $user */
35
34
$ user = $ this ->getUserManager ()->getCurrentUser ();
36
35
37
- if (!$ user instanceof UserInterface) {
36
+ if ($ user instanceof \stdClass) {
37
+ $ id = $ user ->uid ;
38
+ }
39
+ else {
38
40
throw new \RuntimeException ('Require user to login before visiting profile page. ' );
39
41
}
40
42
41
- $ this ->userVisitProfile ( $ user-> getAccountName () );
43
+ $ this ->visitPath ( " / user/ $ id /edit " );
42
44
}
43
45
44
46
/**
Original file line number Diff line number Diff line change @@ -19,6 +19,12 @@ Feature: Check that UserTrait works for or D9
19
19
When I edit user "authenticated_user" profile
20
20
Then I should get a 200 HTTP response
21
21
22
+ @api
23
+ Scenario : Assert "When I go to my profile edit page"
24
+ Given I am logged in as a user with the "administrator" role
25
+ When I go to my profile edit page
26
+ Then I should get a 200 HTTP response
27
+
22
28
@api
23
29
Scenario : Assert "Given no users:" by name
24
30
Given I am logged in as a user with the "administrator" role
You can’t perform that action at this time.
0 commit comments