You are here

public function vfsStreamDirectoryTestCase::owner in Zircon Profile 8

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

setting and retrieving owner of a file

@test @group permissions

File

vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamDirectoryTestCase.php, line 311

Class

vfsStreamDirectoryTestCase
Test for org\bovigo\vfs\vfsStreamDirectory.

Namespace

org\bovigo\vfs

Code

public function owner() {
  $this
    ->assertEquals(vfsStream::getCurrentUser(), $this->dir
    ->getUser());
  $this
    ->assertTrue($this->dir
    ->isOwnedByUser(vfsStream::getCurrentUser()));
  $this
    ->assertSame($this->dir, $this->dir
    ->chown(vfsStream::OWNER_USER_1));
  $this
    ->assertEquals(vfsStream::OWNER_USER_1, $this->dir
    ->getUser());
  $this
    ->assertTrue($this->dir
    ->isOwnedByUser(vfsStream::OWNER_USER_1));
}