? l_class_test.patch
? l_class_test_2.patch
? menu_set_item_3.patch
? menu_set_item_4.patch
? modules/simpletest/tests/l_class_test.patch
? sites/default/files
? sites/default/settings.php
Index: modules/simpletest/tests/common.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/common.test,v
retrieving revision 1.18
diff -u -p -r1.18 common.test
--- modules/simpletest/tests/common.test	9 Dec 2008 11:09:26 -0000	1.18
+++ modules/simpletest/tests/common.test	26 Dec 2008 16:26:24 -0000
@@ -592,4 +592,37 @@ 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 {
+  /**
+   * Implementation of getInfo().
+   */
+  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 = l(t('doesnt matter'), $_GET['q']);
+    $this->assertEqual($link, '<a href="'. url($_GET['q']) .'" class="active">'. t('doesnt matter') .'</a>', t('Active class is present on the current page'));
+  }
+
+  /**
+   * Tests for custom class in l function.
+   */
+  function testDrupalLClassPresent() {
+    $link = l(t('doesnt matter'), $_GET['q'], array('attributes' => array('class' => 'class_set')));
+    $this->assertEqual($link, '<a href="'. url($_GET['q']) .'" class="class_set active">'. t('doesnt matter') .'</a>', t('Specified class is present on the current page'));
+  }
+
+}
