summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2018-03-14 23:58:31 (GMT)
committerAlex Pott2018-03-14 23:58:31 (GMT)
commita7ba6272202a5072cd87c84917a2aa7c614b330d (patch)
tree04ba3249db54c9a2f6f61b9a00a2325b78fa615f
parent126b594c58ebd9edd198fa3d772d6e56eeec7871 (diff)
Issue #2913901 by jhedstrom: Non-helpful error when BrowserTestBase::clickLink doesn't find the link
-rw-r--r--core/tests/Drupal/Tests/BrowserTestBase.php1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/tests/Drupal/Tests/BrowserTestBase.php b/core/tests/Drupal/Tests/BrowserTestBase.php
index 0874190..25756bf 100644
--- a/core/tests/Drupal/Tests/BrowserTestBase.php
+++ b/core/tests/Drupal/Tests/BrowserTestBase.php
@@ -1177,6 +1177,7 @@ abstract class BrowserTestBase extends TestCase {
protected function clickLink($label, $index = 0) {
$label = (string) $label;
$links = $this->getSession()->getPage()->findAll('named', ['link', $label]);
+ $this->assertArrayHasKey($index, $links, 'The link ' . $label . ' was not found on the page.');
$links[$index]->click();
}