public function DevelSwitchUserTest::assertSwitchUserListCount in Devel 4.x
Same name and namespace in other branches
- 8.3 tests/src/Functional/DevelSwitchUserTest.php \Drupal\Tests\devel\Functional\DevelSwitchUserTest::assertSwitchUserListCount()
 - 8 tests/src/Functional/DevelSwitchUserTest.php \Drupal\Tests\devel\Functional\DevelSwitchUserTest::assertSwitchUserListCount()
 - 8.2 tests/src/Functional/DevelSwitchUserTest.php \Drupal\Tests\devel\Functional\DevelSwitchUserTest::assertSwitchUserListCount()
 
Helper function for verify the number of items shown in the user list.
Parameters
int $number: The expected numer of items.
2 calls to DevelSwitchUserTest::assertSwitchUserListCount()
- DevelSwitchUserTest::testSwitchUserBlockConfiguration in tests/
src/ Functional/ DevelSwitchUserTest.php  - Tests the switch user block configuration.
 - DevelSwitchUserTest::testSwitchUserListItems in tests/
src/ Functional/ DevelSwitchUserTest.php  - Test the user list items.
 
File
- tests/
src/ Functional/ DevelSwitchUserTest.php, line 214  
Class
- DevelSwitchUserTest
 - Tests switch user.
 
Namespace
Drupal\Tests\devel\FunctionalCode
public function assertSwitchUserListCount($number) {
  $result = $this
    ->xpath('//div[@id=:block]//ul/li/a', [
    ':block' => 'block-switch-user',
  ]);
  $this
    ->assertTrue(count($result) == $number, 'The number of users shown in switch user is correct.');
}