function UserPermissionsTest::testPermissionTableHtml

Tests that module header rows in the permissions table have a single cell.

File

core/modules/user/tests/src/Functional/UserPermissionsTest.php, line 364

Class

UserPermissionsTest
Verifies role permissions can be added and removed via the permissions page.

Namespace

Drupal\Tests\user\Functional

Code

public function testPermissionTableHtml() : void {
    $this->drupalLogin($this->adminUser);
    \Drupal::service('module_installer')->install([
        'user_permissions_test',
    ]);
    $this->drupalGet('admin/people/permissions');
    // Verify that if a permission has the same name as a module, that its
    // table cells aren't combined into the module's header row. The header row
    // should have a single cell in that case.
    $header_row = $this->xpath('//tr[@data-drupal-selector=\'edit-permissions-module-user-permissions-test\'][count(td)=1]');
    $this->assertNotEmpty($header_row);
}

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