You are here

protected function UpdateTestBase::findUpdateElementByLabel in Drupal 8

Same name and namespace 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()

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];
}