function UserAdminTest::getLinkSelectorForUser

Same name in other branches
  1. 9 core/modules/user/tests/src/Functional/UserAdminTest.php \Drupal\Tests\user\Functional\UserAdminTest::getLinkSelectorForUser()
  2. 11.x core/modules/user/tests/src/Functional/UserAdminTest.php \Drupal\Tests\user\Functional\UserAdminTest::getLinkSelectorForUser()

Gets the xpath selector for a user account.

Parameters

\Drupal\user\UserInterface $user: The user to get the link for.

Return value

string The xpath selector for the user link.

1 call to UserAdminTest::getLinkSelectorForUser()
UserAdminTest::testUserAdmin in core/modules/user/tests/src/Functional/UserAdminTest.php
Registers a user and deletes it.

File

core/modules/user/tests/src/Functional/UserAdminTest.php, line 42

Class

UserAdminTest
Tests user administration page functionality.

Namespace

Drupal\Tests\user\Functional

Code

private static function getLinkSelectorForUser(UserInterface $user) : string {
    return '//td[contains(@class, "views-field-name")]/a[text()="' . $user->getAccountName() . '"]';
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.