function UrlTest::testLCustomClass

Tests for custom class in l() function.

File

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

Class

UrlTest
Tests for URL generation functions.

Namespace

Drupal\system\Tests\Common

Code

function testLCustomClass() {
  $class = $this
    ->randomName();
  $link = l($this
    ->randomName(), current_path(), array(
    'attributes' => array(
      'class' => array(
        $class,
      ),
    ),
  ));
  $this
    ->assertTrue($this
    ->hasClass($link, $class), format_string('Custom class @class is present on link when requested', array(
    '@class' => $class,
  )));
}