You are here

protected function WebformListBuilderTest::assertLinkNotInRow in Webform 6.x

Same name and namespace in other branches
  1. 8.5 tests/src/Functional/WebformListBuilderTest.php \Drupal\Tests\webform\Functional\WebformListBuilderTest::assertLinkNotInRow()

Asserts a link is not in a row.

Parameters

string $row_text: Text to find a row.

string $link: The link to find.

Throws

\Exception When the row can't be found.

1 call to WebformListBuilderTest::assertLinkNotInRow()
WebformListBuilderTest::testAccess in tests/src/Functional/WebformListBuilderTest.php
Tests the webform overview access.

File

tests/src/Functional/WebformListBuilderTest.php, line 264

Class

WebformListBuilderTest
Tests for webform list builder.

Namespace

Drupal\Tests\webform\Functional

Code

protected function assertLinkNotInRow($row_text, $link) {
  $row = $this
    ->getSession()
    ->getPage()
    ->find('css', sprintf('table tr:contains("%s")', $row_text));
  if (!$row) {
    throw new \Exception($this
      ->getSession()
      ->getDriver(), 'table row', 'value', $row_text);
  }
  $links = $row
    ->findAll('named', [
    'link',
    $link,
  ]);
  $this
    ->assertEmpty($links, sprintf('Link with label %s found in row %s.', $link, $row_text));
}