diff --git b/tests/example/example_1.php a/tests/example/example_1.php index 7bf536d..a55cbf0 100644 --- b/tests/example/example_1.php +++ a/tests/example/example_1.php @@ -5,6 +5,7 @@ * Test PHP file for Libraries loading. */ +// @see _libraries_require_once() $path = 'abc'; /** diff --git b/tests/example/example_2.php a/tests/example/example_2.php index ddded40..4f06edf 100644 --- b/tests/example/example_2.php +++ a/tests/example/example_2.php @@ -5,6 +5,9 @@ * Test PHP file for Libraries loading. */ +// @see _libraries_require_once() +$path = 'abc'; + /** * Dummy function to see if this file was loaded. */ diff --git b/tests/libraries.test a/tests/libraries.test index 1770162..eba4077 100644 --- b/tests/libraries.test +++ a/tests/libraries.test @@ -303,6 +303,12 @@ class LibrariesTestCase extends DrupalWebTestCase { $loaded = &drupal_static('libraries_load'); $this->verbose('
' . var_export($loaded, TRUE) . ''); $this->assertEqual($loaded['example_dependency']['loaded'], 1, 'Dependency library is also loaded'); + + // Test that PHP files that have a local $path variable do not break library + // loading. + // @see _libraries_require_once() + $library = libraries_load('example_path_variable_override'); + $this->assertEqual($library['loaded'], 2, 'PHP files cannot break library loading.'); } /** diff --git b/tests/libraries_test.module a/tests/libraries_test.module index faae509..dfc13ff 100644 --- b/tests/libraries_test.module +++ a/tests/libraries_test.module @@ -287,6 +287,15 @@ function libraries_test_libraries_info() { 'post-load callback' => 'not applied', ); + $libraries['example_path_variable_override'] = array( + 'name' => 'Example path variable override', + 'library path' => drupal_get_path('module', 'libraries') . '/tests/example', + 'version' => '1', + 'files' => array( + 'php' => array('example_1.php', 'example_2.php'), + ), + ); + return $libraries; }