diff --git a/core/lib/Drupal/Core/StreamWrapper/ModuleStream.php b/core/lib/Drupal/Core/StreamWrapper/ModuleStream.php index efd81a0..b56f183 100644 --- a/core/lib/Drupal/Core/StreamWrapper/ModuleStream.php +++ b/core/lib/Drupal/Core/StreamWrapper/ModuleStream.php @@ -21,8 +21,8 @@ public function getOwnerName($uri = NULL) { return $name; } else { - // The module does not exist or is disabled. - throw new \InvalidArgumentException(sprintf('Module %s does not exist or is disabled', $name)); + // The module does not exist or is not enabled. + throw new \InvalidArgumentException(sprintf('Module %s does not exist or is not enabled', $name)); } } diff --git a/core/lib/Drupal/Core/StreamWrapper/SystemStream.php b/core/lib/Drupal/Core/StreamWrapper/SystemStream.php index 4460ee6..019cf88 100644 --- a/core/lib/Drupal/Core/StreamWrapper/SystemStream.php +++ b/core/lib/Drupal/Core/StreamWrapper/SystemStream.php @@ -53,7 +53,7 @@ public function getTarget($uri = NULL) { return trim($target, '/'); } else { - throw new \InvalidArgumentException(sprintf('Target %s does not exist', $uri)); + throw new \InvalidArgumentException(sprintf('File %s does not exist', $uri)); } } @@ -85,6 +85,6 @@ public function getExternalUrl($uri = NULL) { $path = rtrim(UrlHelper::encodePath(str_replace('\\', '/', $path)), '/'); } - return \Drupal::request()->getUri() . $dir . $path; + return \Drupal::request()->getUriForPath('/' . $dir . $path); } } diff --git a/core/modules/system/src/Tests/File/SystemStreamUnitTest.php b/core/modules/system/src/Tests/File/SystemStreamTest.php similarity index 98% rename from core/modules/system/src/Tests/File/SystemStreamUnitTest.php rename to core/modules/system/src/Tests/File/SystemStreamTest.php index be33a14..75d4be9 100644 --- a/core/modules/system/src/Tests/File/SystemStreamUnitTest.php +++ b/core/modules/system/src/Tests/File/SystemStreamTest.php @@ -2,7 +2,7 @@ /** * @file - * Contains \Drupal\system\Tests\File\SystemStreamUnitTest. + * Contains \Drupal\system\Tests\File\SystemStreamTest. */ namespace Drupal\system\Tests\File; @@ -16,7 +16,7 @@ * * @group system */ -class SystemStreamUnitTest extends KernelTestBase { +class SystemStreamTest extends KernelTestBase { /** * Modules to enable. @@ -404,7 +404,10 @@ private function runTestOnInstanceMethod($instance, $method, array $data) { } } else { - $this->assertEqual($instance->$method($uri), $info[0], $info[1]); + if (!$this->assertEqual($instance->$method($uri), $info[0], $info[1])) { + debug($instance->$method($uri), get_class($instance) . "::$method('$uri')"); + debug($info[0], 'expected'); + } } } }