From 0e514af22e33c2d00631ee3e0128c28c56503dc2 Mon Sep 17 00:00:00 2001
From: catch <catch@35733.no-reply.drupal.org>
Date: Tue, 12 Feb 2013 21:34:28 +0000
Subject: [PATCH] Issue #1911190 by mitron: Test that drupal_get_filename() has
 NULL return value when the file is not found.

---
 .../Drupal/system/Tests/Bootstrap/GetFilenameUnitTest.php    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/GetFilenameUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/GetFilenameUnitTest.php
index 27ea1d763432..a4763b69a88f 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/GetFilenameUnitTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/GetFilenameUnitTest.php
@@ -17,7 +17,7 @@ class GetFilenameUnitTest extends UnitTestBase {
   public static function getInfo() {
     return array(
       'name' => 'Get filename test',
-      'description' => 'Test that drupal_get_filename() works correctly when the file is not found in the database.',
+      'description' => 'Test that drupal_get_filename() works correctly.',
       'group' => 'Bootstrap',
     );
   }
@@ -50,5 +50,8 @@ function testDrupalGetFilename() {
     // will automatically check there for 'script' files, just as it does
     // for (e.g.) 'module' files in core/modules.
     $this->assertIdentical(drupal_get_filename('script', 'test'), 'core/scripts/test/test.script');
+
+    // Searching for an item that does not exist returns NULL.
+    $this->assertNull(drupal_get_filename('module', uniqid("", TRUE)), 'Searching for an item that does not exist returns NULL.');
   }
 }
-- 
GitLab