summaryrefslogtreecommitdiff
path: root/modules/simpletest
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2015-03-30 00:29:14 -0400
committerDavid Rothstein <drothstein@gmail.com>2015-03-30 00:29:14 -0400
commitea48131869663312ab598d281197bc96bc8c1ac7 (patch)
tree4d8735caed7a1a87cbb9acff38c6029aef83037d /modules/simpletest
parent9dafd622f00485a1889bfd22bcf1291e2aed647b (diff)
downloadbrdo-ea48131869663312ab598d281197bc96bc8c1ac7.tar.gz
brdo-ea48131869663312ab598d281197bc96bc8c1ac7.tar.bz2
Issue #2170453 by Darren Oh, mikeryan, Fabianx: Ignore case in code registry lookups
Diffstat (limited to 'modules/simpletest')
-rw-r--r--modules/simpletest/tests/bootstrap.test29
-rw-r--r--modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test.info8
-rw-r--r--modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test.module6
-rw-r--r--modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test_class.inc11
-rw-r--r--modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test_interface.inc11
5 files changed, 65 insertions, 0 deletions
diff --git a/modules/simpletest/tests/bootstrap.test b/modules/simpletest/tests/bootstrap.test
index 3489062f1..ece1cd9e9 100644
--- a/modules/simpletest/tests/bootstrap.test
+++ b/modules/simpletest/tests/bootstrap.test
@@ -289,6 +289,35 @@ class BootstrapVariableTestCase extends DrupalWebTestCase {
}
/**
+ * Tests the auto-loading behavior of the code registry.
+ */
+class BootstrapAutoloadTestCase extends DrupalWebTestCase {
+
+ public static function getInfo() {
+ return array(
+ 'name' => 'Code registry',
+ 'description' => 'Test that the code registry functions correctly.',
+ 'group' => 'Bootstrap',
+ );
+ }
+
+ function setUp() {
+ parent::setUp('drupal_autoload_test');
+ }
+
+ /**
+ * Tests that autoloader name matching is not case sensitive.
+ */
+ function testAutoloadCase() {
+ // Test interface autoloader.
+ $this->assertTrue(drupal_autoload_interface('drupalautoloadtestinterface'), 'drupal_autoload_interface() recognizes <em>DrupalAutoloadTestInterface</em> in lower case.');
+ // Test class autoloader.
+ $this->assertTrue(drupal_autoload_class('drupalautoloadtestclass'), 'drupal_autoload_class() recognizes <em>DrupalAutoloadTestClass</em> in lower case.');
+ }
+
+}
+
+/**
* Test hook_boot() and hook_exit().
*/
class HookBootExitTestCase extends DrupalWebTestCase {
diff --git a/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test.info b/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test.info
new file mode 100644
index 000000000..4660de367
--- /dev/null
+++ b/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test.info
@@ -0,0 +1,8 @@
+name = "Drupal code registry test"
+description = "Support module for testing the code registry."
+files[] = drupal_autoload_test_interface.inc
+files[] = drupal_autoload_test_class.inc
+package = Testing
+version = VERSION
+core = 7.x
+hidden = TRUE
diff --git a/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test.module b/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test.module
new file mode 100644
index 000000000..37aa94eb8
--- /dev/null
+++ b/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test.module
@@ -0,0 +1,6 @@
+<?php
+
+/**
+ * @file
+ * Test module to check code registry.
+ */
diff --git a/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test_class.inc b/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test_class.inc
new file mode 100644
index 000000000..afd72fe64
--- /dev/null
+++ b/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test_class.inc
@@ -0,0 +1,11 @@
+<?php
+
+/**
+ * @file
+ * Test classes for code registry testing.
+ */
+
+/**
+ * This class is empty because we only care if Drupal can find it.
+ */
+class DrupalAutoloadTestClass implements DrupalAutoloadTestInterface {}
diff --git a/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test_interface.inc b/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test_interface.inc
new file mode 100644
index 000000000..d20ce5234
--- /dev/null
+++ b/modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test_interface.inc
@@ -0,0 +1,11 @@
+<?php
+
+/**
+ * @file
+ * Test interfaces for code registry testing.
+ */
+
+/**
+ * This interface is empty because we only care if Drupal can find it.
+ */
+interface DrupalAutoloadTestInterface {}