diff --git includes/bootstrap.inc includes/bootstrap.inc index be0a471..b47ac36 100644 --- includes/bootstrap.inc +++ includes/bootstrap.inc @@ -677,7 +677,7 @@ function drupal_get_filename($type, $name, $filename = NULL) { try { if (function_exists('db_query')) { $file = db_query("SELECT filename FROM {system} WHERE name = :name AND type = :type", array(':name' => $name, ':type' => $type))->fetchField(); - if (file_exists(DRUPAL_ROOT . '/' . $file)) { + if (!empty($file) && file_exists(DRUPAL_ROOT . '/' . $file)) { $files[$type][$name] = $file; } } diff --git modules/simpletest/tests/bootstrap.test modules/simpletest/tests/bootstrap.test index 333f34b..c7774aa 100644 --- modules/simpletest/tests/bootstrap.test +++ modules/simpletest/tests/bootstrap.test @@ -324,7 +324,7 @@ class HookBootExitTestCase extends DrupalWebTestCase { /** * Test drupal_get_filename()'s availability. */ -class BootstrapGetFilenameTestCase extends DrupalUnitTestCase { +class BootstrapGetFilenameTestCase extends DrupalWebTestCase { public static function getInfo() { return array( @@ -497,4 +497,3 @@ class BootstrapOverrideServerVariablesTestCase extends DrupalUnitTestCase { } } } -