diff --git a/core/modules/image/lib/Drupal/image/Tests/ImageAdminStylesTest.php b/core/modules/image/lib/Drupal/image/Tests/ImageAdminStylesTest.php index 84a5ed458..e578c0d 100644 --- a/core/modules/image/lib/Drupal/image/Tests/ImageAdminStylesTest.php +++ b/core/modules/image/lib/Drupal/image/Tests/ImageAdminStylesTest.php @@ -309,7 +309,7 @@ function testEditEffect() { $this->assertText(t('Scale and crop 300x200')); // There should normally be only one edit link on this page initially. - $this->clickLink(t('edit')); + $this->clickLink(t('edit'), 1); $this->drupalPost(NULL, array('data[width]' => '360', 'data[height]' => '240'), t('Update effect')); $this->assertText(t('Scale and crop 360x240')); @@ -323,7 +323,7 @@ function testEditEffect() { $this->drupalPost(NULL, array('data[width]' => '12', 'data[height]' => '19'), t('Add effect')); // Edit the scale effect that was just added. - $this->clickLink(t('edit')); + $this->clickLink(t('edit'), 1); $this->drupalPost(NULL, array('data[width]' => '24', 'data[height]' => '19'), t('Update effect')); $this->drupalPost(NULL, array('new' => 'image_scale'), t('Add')); diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php index 138bf34..93608fe 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php @@ -1921,12 +1921,14 @@ protected function assertNoLinkByHref($href, $message = '', $group = 'Other') { * Follows a link by name. * * Will click the first link found with this link text by default, or a - * later one if an index is given. Match is case insensitive with - * normalized space. The label is translated label. There is an assert - * for successful click. + * later one if an index is given. Match is case insensitive for ASCII + * characters. Leading and trailing whitesapce is removed from the link text + * and internal sequences of whitespace is replaced by a single space. + * Succesful click is asserted. * * @param $label - * Text between the anchor tags. + * Text between the anchor tags. This needs to be translated if the page + * is translated. * @param $index * Link position counting from zero. * @return @@ -1934,7 +1936,8 @@ protected function assertNoLinkByHref($href, $message = '', $group = 'Other') { */ protected function clickLink($label, $index = 0) { $url_before = $this->getUrl(); - $urls = $this->xpath('//a[normalize-space(text())=:label]', array(':label' => $label)); + // Replace the text to lowercase, so that clickLink() is not case sensitive. + $urls = $this->xpath("//a[normalize-space(translate(text(), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'))=:label]", array(':label' => strtolower($label))); if (isset($urls[$index])) { $url_target = $this->getAbsoluteUrl($urls[$index]['href']); diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php index 9f65f1c..5ccc179 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php @@ -312,7 +312,7 @@ function testTermInterface() { // Test edit link as accessed from Taxonomy administration pages. // Because Simpletest creates its own database when running tests, we know // the first edit link found on the listing page is to our term. - $this->clickLink(t('edit')); + $this->clickLink(t('edit'), 1); $this->assertRaw($edit['name'], 'The randomly generated term name is present.'); $this->assertText($edit['description[value]'], 'The randomly generated term description is present.');