You are here

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

@test @group issue_11 @group permissions

File

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

Class

vfsStreamWrapperTestCase
Test for org\bovigo\vfs\vfsStreamWrapper.

Namespace

org\bovigo\vfs

Code

public function chownChangesUser() {
  if (version_compare(phpversion(), '5.4.0', '<')) {
    $this->foo
      ->chown(vfsStream::OWNER_USER_1);
    $this->bar
      ->chown(vfsStream::OWNER_USER_1);
    $this->baz1
      ->chown(vfsStream::OWNER_USER_2);
    $this->baz2
      ->chown(vfsStream::OWNER_USER_2);
  }
  else {
    chown($this->fooURL, vfsStream::OWNER_USER_1);
    chown($this->barURL, vfsStream::OWNER_USER_1);
    chown($this->baz1URL, vfsStream::OWNER_USER_2);
    chown($this->baz2URL, vfsStream::OWNER_USER_2);
  }
  $this
    ->assertEquals(vfsStream::OWNER_USER_1, fileowner($this->fooURL));
  $this
    ->assertEquals(vfsStream::OWNER_USER_1, fileowner($this->fooURL . '/.'));
  $this
    ->assertEquals(vfsStream::OWNER_USER_1, fileowner($this->barURL));
  $this
    ->assertEquals(vfsStream::OWNER_USER_1, fileowner($this->barURL . '/.'));
  $this
    ->assertEquals(vfsStream::OWNER_USER_2, fileowner($this->baz1URL));
  $this
    ->assertEquals(vfsStream::OWNER_USER_2, fileowner($this->baz2URL));
}