summaryrefslogtreecommitdiffstats
path: root/core/modules/system/lib/Drupal/system/Tests/Common/UrlTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/modules/system/lib/Drupal/system/Tests/Common/UrlTest.php')
-rw-r--r--core/modules/system/lib/Drupal/system/Tests/Common/UrlTest.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/UrlTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/UrlTest.php
index 473e352..39ed2b4 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/UrlTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/UrlTest.php
@@ -53,6 +53,17 @@ class UrlTest extends WebTestBase {
$this->assertTrue($this->hasClass($link, 'active'), format_string('Class @class is present on link to the current page', array('@class' => 'active')));
}
+ /**
+ * Checks for class existence in link.
+ *
+ * @param $link
+ * URL to search.
+ * @param $class
+ * Element class to search for.
+ *
+ * @return bool
+ * TRUE if the class is found, FALSE otherwise.
+ */
private function hasClass($link, $class) {
return preg_match('|class="([^\"\s]+\s+)*' . $class . '|', $link);
}