function CommonURLUnitTest::testLCustomClass
Tests for custom class in l() function.
File
-
modules/
simpletest/ tests/ common.test, line 127
Class
- CommonURLUnitTest
- Tests for URL generation functions.
Code
function testLCustomClass() {
$class = $this->randomName();
$link = l($this->randomName(), $_GET['q'], 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,
)));
$this->assertTrue($this->hasClass($link, 'active'), format_string('Class @class is present on link to the current page', array(
'@class' => 'active',
)));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.