You are here

public function vfsStreamFileTestCase::owner in Zircon Profile 8.0

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

setting and retrieving owner of a file

@test @group permissions

File

vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamFileTestCase.php, line 228

Class

vfsStreamFileTestCase
Test for org\bovigo\vfs\vfsStreamFile.

Namespace

org\bovigo\vfs

Code

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