private function UrlTest::hasClass

Checks for class existence in link.

Parameters

$link: URL to search.

$class: Element class to search for.

Return value

bool TRUE if the class is found, FALSE otherwise.

1 call to UrlTest::hasClass()
UrlTest::testLCustomClass in drupal/core/modules/system/lib/Drupal/system/Tests/Common/UrlTest.php
Tests for custom class in l() function.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Common/UrlTest.php, line 85
Definition of Drupal\system\Tests\Common\UrlTest.

Class

UrlTest
Tests for URL generation functions.

Namespace

Drupal\system\Tests\Common

Code

private function hasClass($link, $class) {
  return preg_match('|class="([^\\"\\s]+\\s+)*' . $class . '|', $link);
}