function UpdateTestBase::findUpdateElementByLabel

Same name in other branches
  1. 9 core/modules/update/tests/src/Functional/UpdateTestBase.php \Drupal\Tests\update\Functional\UpdateTestBase::findUpdateElementByLabel()
  2. 10 core/modules/update/tests/src/Functional/UpdateTestBase.php \Drupal\Tests\update\Functional\UpdateTestBase::findUpdateElementByLabel()
  3. 11.x core/modules/update/tests/src/Functional/UpdateTestBase.php \Drupal\Tests\update\Functional\UpdateTestBase::findUpdateElementByLabel()

Finds an update page element by label.

Parameters

string $label: The label for the update, for example "Recommended version:" or "Latest version:".

Return value

\Behat\Mink\Element\NodeElement The update element.

2 calls to UpdateTestBase::findUpdateElementByLabel()
UpdateContribTest::assertCoreCompatibilityMessage in core/modules/update/tests/src/Functional/UpdateContribTest.php
Asserts that a core compatibility message is correct for an update.
UpdateTestBase::assertVersionUpdateLinks in core/modules/update/tests/src/Functional/UpdateTestBase.php
Asserts that an update version has the correct links.

File

core/modules/update/tests/src/Functional/UpdateTestBase.php, line 287

Class

UpdateTestBase
Defines some shared functions used by all update tests.

Namespace

Drupal\Tests\update\Functional

Code

protected function findUpdateElementByLabel($label) {
    $update_elements = $this->getSession()
        ->getPage()
        ->findAll('css', $this->updateTableLocator . " .project-update__version:contains(\"{$label}\")");
    $this->assertCount(1, $update_elements);
    return $update_elements[0];
}

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