Index: modules/simpletest/tests/common.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/common.test,v
retrieving revision 1.21
diff -u -p -r1.21 common.test
--- modules/simpletest/tests/common.test	11 Jan 2009 08:39:08 -0000	1.21
+++ modules/simpletest/tests/common.test	11 Jan 2009 20:58:14 -0000
@@ -700,4 +700,38 @@ class DrupalErrorCollectionUnitTest exte
       $this->assertEqual($error['message'], $message, t("Message was %message", array('%message' => $message)));
     }
   }
-}
\ No newline at end of file
+}
+
+/**
+ * Test the l() function if the class is properly added.
+ */
+class DrupalLClassTestCase extends DrupalWebTestCase {
+  function getInfo() {
+    return array(
+      'name' => t('Drupal l() class test'),
+      'description'=> t("Performs test on Drupal's l() function class specifying mechanism."),
+      'group' => t('System'),
+    );
+  }
+
+  /**
+   * Tests for active class in l() function.
+   */
+  function testDrupalLActiveClass() {
+    $link_text = $this->randomName();
+    $link = l($link_text, $_GET['q']);
+    $this->assertEqual($link, '<a href="' . url($_GET['q']) . '" class="active">' . $link_text .
+      '</a>', t('Active class is present on the current page'));
+  }
+
+  /**
+   * Tests for custom class in l() function.
+   */
+  function testDrupalLClassPresent() {
+    $link_text = $this->randomName();
+    $link = l($link_text, $_GET['q'], array('attributes' => array('class' => 'class_set')));
+    $this->assertEqual($link, '<a href="' . url($_GET['q']) . '" class="class_set active">' .
+      $link_text . '</a>', t('Specified class is present on the current page'));
+  }
+
+}
