You are here

public function vfsStreamWrapperTestCase::is_writable in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperTestCase.php \org\bovigo\vfs\vfsStreamWrapperTestCase::is_writable()

assert is_writable() works correct

@test

File

vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperTestCase.php, line 178

Class

vfsStreamWrapperTestCase
Test for org\bovigo\vfs\vfsStreamWrapper.

Namespace

org\bovigo\vfs

Code

public function is_writable() {
  $this
    ->assertTrue(is_writable($this->fooURL));
  $this
    ->assertTrue(is_writable($this->fooURL . '/.'));
  $this
    ->assertTrue(is_writable($this->barURL));
  $this
    ->assertTrue(is_writable($this->barURL . '/.'));
  $this
    ->assertTrue(is_writable($this->baz1URL));
  $this
    ->assertTrue(is_writable($this->baz2URL));
  $this
    ->assertFalse(is_writable($this->fooURL . '/another'));
  $this
    ->assertFalse(is_writable(vfsStream::url('another')));
  $this->foo
    ->chmod(0444);
  $this
    ->assertFalse(is_writable($this->fooURL));
  $this->baz1
    ->chmod(0444);
  $this
    ->assertFalse(is_writable($this->baz1URL));
}