function TmgmtTestTrait::clickLinkWithImageTitle

Clicks on an image link with the provided title attribute.

Parameters

string $title: The image title.

5 calls to TmgmtTestTrait::clickLinkWithImageTitle()
ConfigSourceUiTest::testFieldConfigTranslateTabSingleCheckout in sources/tmgmt_config/tests/src/Functional/ConfigSourceUiTest.php
Test the field config entity type for a single checkout.
ConfigSourceUiTest::testNodeTypeTranslateTabSingleCheckout in sources/tmgmt_config/tests/src/Functional/ConfigSourceUiTest.php
Test the node type for a single checkout.
ConfigSourceUiTest::testSimpleConfiguration in sources/tmgmt_config/tests/src/Functional/ConfigSourceUiTest.php
Test the node type for a single checkout.
ConfigSourceUiTest::testViewTranslateTabSingleCheckout in sources/tmgmt_config/tests/src/Functional/ConfigSourceUiTest.php
Test the node type for a single checkout.
ContentTmgmtEntitySourceUiTest::testNodeTranslateTabSingleCheckout in sources/content/tests/src/Functional/ContentTmgmtEntitySourceUiTest.php
Test the translate tab for a single checkout.

File

tests/src/Functional/TmgmtTestTrait.php, line 183

Class

TmgmtTestTrait
Base class for tests.

Namespace

Drupal\Tests\tmgmt\Functional

Code

function clickLinkWithImageTitle($title) {
  $urls = $this
    ->xpath('//a[img[@title=:title]]', [
    ':title' => 'Needs review',
  ]);
  if (empty($urls)) {
    $this
      ->fail('No image link with title' . $title . ' found');
    return;
  }
  $url_target = $this
    ->getAbsoluteUrl($urls[0]
    ->getAttribute('href'));
  $this
    ->drupalGet($url_target);
}