From ea48131869663312ab598d281197bc96bc8c1ac7 Mon Sep 17 00:00:00 2001 From: David Rothstein Date: Mon, 30 Mar 2015 00:29:14 -0400 Subject: Issue #2170453 by Darren Oh, mikeryan, Fabianx: Ignore case in code registry lookups --- modules/simpletest/tests/bootstrap.test | 29 ++++++++++++++++++++++ .../drupal_autoload_test/drupal_autoload_test.info | 8 ++++++ .../drupal_autoload_test.module | 6 +++++ .../drupal_autoload_test_class.inc | 11 ++++++++ .../drupal_autoload_test_interface.inc | 11 ++++++++ 5 files changed, 65 insertions(+) create mode 100644 modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test.info create mode 100644 modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test.module create mode 100644 modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test_class.inc create mode 100644 modules/simpletest/tests/drupal_autoload_test/drupal_autoload_test_interface.inc (limited to 'modules/simpletest') 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 @@ -288,6 +288,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 DrupalAutoloadTestInterface in lower case.'); + // Test class autoloader. + $this->assertTrue(drupal_autoload_class('drupalautoloadtestclass'), 'drupal_autoload_class() recognizes DrupalAutoloadTestClass in lower case.'); + } + +} + /** * Test hook_boot() and hook_exit(). */ 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 @@ +