Loading core/lib/Drupal/Core/StreamWrapper/LocalReadOnlyStream.php +7 −0 Changes for core/lib/Drupal/Core/StreamWrapper/LocalReadOnlyStream.php: 7 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -15,6 +15,13 @@ */ abstract class LocalReadOnlyStream extends LocalStream { /** * {@inheritdoc} */ public static function getType() { return StreamWrapperInterface::READ_VISIBLE; } /** * Support for fopen(), file_get_contents(), etc. * Loading core/modules/system/src/Tests/File/ReadOnlyStreamWrapperTest.php +7 −0 Changes for core/modules/system/src/Tests/File/ReadOnlyStreamWrapperTest.php: 7 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -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. * Loading @@ -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'); Loading Loading
core/lib/Drupal/Core/StreamWrapper/LocalReadOnlyStream.php +7 −0 Changes for core/lib/Drupal/Core/StreamWrapper/LocalReadOnlyStream.php: 7 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -15,6 +15,13 @@ */ abstract class LocalReadOnlyStream extends LocalStream { /** * {@inheritdoc} */ public static function getType() { return StreamWrapperInterface::READ_VISIBLE; } /** * Support for fopen(), file_get_contents(), etc. * Loading
core/modules/system/src/Tests/File/ReadOnlyStreamWrapperTest.php +7 −0 Changes for core/modules/system/src/Tests/File/ReadOnlyStreamWrapperTest.php: 7 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -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. * Loading @@ -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'); Loading