Commit 7b0d229a authored by alexpott's avatar alexpott

Issue #2767269 by claudiu.cristea: LocalReadOnlyStream must declare itself not writeable

parent 7b9c79ea
......@@ -15,6 +15,13 @@
*/
abstract class LocalReadOnlyStream extends LocalStream {
/**
* {@inheritdoc}
*/
public static function getType() {
return StreamWrapperInterface::READ_VISIBLE;
}
/**
* {@inheritdoc}
*/
......
......@@ -2,6 +2,9 @@
namespace Drupal\KernelTests\Core\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->assertSame(0, $type & StreamWrapperInterface::WRITE);
// Generate a test file
$filename = $this->randomMachineName();
$site_path = $this->container->get('site.path');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment