function UpdateManagerUpdateTest::checkTableHeaders

Same name in other branches
  1. 11.x core/modules/update/tests/src/Functional/UpdateManagerUpdateTest.php \Drupal\Tests\update\Functional\UpdateManagerUpdateTest::checkTableHeaders()

Checks headers for a given table on the Update form.

Parameters

string $table_locator: CSS locator to find the table to check the headers on.

string[] $expected_headers: Array of expected header texts, keyed by CSS selectors relative to the thead tr (for example, "th:nth-of-type(3)").

1 call to UpdateManagerUpdateTest::checkTableHeaders()
UpdateManagerUpdateTest::testUninstalledUpdatesTable in core/modules/update/tests/src/Functional/UpdateManagerUpdateTest.php
Tests the Update form with an uninstalled module in the system.

File

core/modules/update/tests/src/Functional/UpdateManagerUpdateTest.php, line 309

Class

UpdateManagerUpdateTest
Tests the Update Manager module's 'Update' form and functionality.

Namespace

Drupal\Tests\update\Functional

Code

private function checkTableHeaders($table_locator, array $expected_headers) {
    $assert_session = $this->assertSession();
    $assert_session->elementExists('css', $table_locator);
    foreach ($expected_headers as $locator => $header) {
        $assert_session->elementTextContains('css', "{$table_locator} thead tr {$locator}", $header);
    }
}

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