You are here

public function vfsStreamWrapperTestCase::chmodModifiesPermissions 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::chmodModifiesPermissions()

@test @group issue_11 @group permissions

File

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

Class

vfsStreamWrapperTestCase
Test for org\bovigo\vfs\vfsStreamWrapper.

Namespace

org\bovigo\vfs

Code

public function chmodModifiesPermissions() {
  if (version_compare(phpversion(), '5.4.0', '<')) {
    $this
      ->assertFalse(@chmod($this->fooURL, 0755));
    $this
      ->assertFalse(@chmod($this->barURL, 0711));
    $this
      ->assertFalse(@chmod($this->baz1URL, 0644));
    $this
      ->assertFalse(@chmod($this->baz2URL, 0664));
    $this
      ->assertEquals(40777, decoct(fileperms($this->fooURL)));
    $this
      ->assertEquals(40777, decoct(fileperms($this->barURL)));
    $this
      ->assertEquals(100666, decoct(fileperms($this->baz1URL)));
    $this
      ->assertEquals(100666, decoct(fileperms($this->baz2URL)));
  }
  else {
    $this
      ->assertTrue(chmod($this->fooURL, 0755));
    $this
      ->assertTrue(chmod($this->barURL, 0711));
    $this
      ->assertTrue(chmod($this->baz1URL, 0644));
    $this
      ->assertTrue(chmod($this->baz2URL, 0664));
    $this
      ->assertEquals(40755, decoct(fileperms($this->fooURL)));
    $this
      ->assertEquals(40711, decoct(fileperms($this->barURL)));
    $this
      ->assertEquals(100644, decoct(fileperms($this->baz1URL)));
    $this
      ->assertEquals(100664, decoct(fileperms($this->baz2URL)));
  }
}