diff --git a/core/lib/Drupal/Core/StreamWrapper/LocalReadOnlyStream.php b/core/lib/Drupal/Core/StreamWrapper/LocalReadOnlyStream.php
index 6e3197c..f26e8c4 100644
--- a/core/lib/Drupal/Core/StreamWrapper/LocalReadOnlyStream.php
+++ b/core/lib/Drupal/Core/StreamWrapper/LocalReadOnlyStream.php
@@ -16,6 +16,13 @@
 abstract class LocalReadOnlyStream extends LocalStream {
 
   /**
+   * {@inheritdoc}
+   */
+  public static function getType() {
+    return StreamWrapperInterface::READ_VISIBLE;
+  }
+
+  /**
    * Support for fopen(), file_get_contents(), etc.
    *
    * Any write modes will be rejected, as this is a read-only stream wrapper.
diff --git a/core/modules/system/src/Tests/File/ReadOnlyStreamWrapperTest.php b/core/modules/system/src/Tests/File/ReadOnlyStreamWrapperTest.php
index d1128c4..44a9af1 100644
--- a/core/modules/system/src/Tests/File/ReadOnlyStreamWrapperTest.php
+++ b/core/modules/system/src/Tests/File/ReadOnlyStreamWrapperTest.php
@@ -2,6 +2,9 @@
 
 namespace Drupal\system\Tests\File;
 
+use Drupal\Core\StreamWrapper\StreamWrapperInterface;
+use Drupal\file_test\StreamWrapper\DummyReadOnlyStreamWrapper;
+
 /**
  * Tests the read-only stream wrapper write functions.
  *
@@ -27,6 +30,10 @@ class ReadOnlyStreamWrapperTest extends FileTestBase {
    * Test read-only specific behavior.
    */
   function testReadOnlyBehavior() {
+    $type = DummyReadOnlyStreamWrapper::getType();
+    // Checks that the stream wrapper type is not declared as writable.
+    $this->assertIdentical(0, $type & StreamWrapperInterface::WRITE);
+
     // Generate a test file
     $filename = $this->randomMachineName();
     $site_path = $this->container->get('site.path');
