You are here

class vfsStreamAbstractContentTestCase in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamAbstractContentTestCase.php \org\bovigo\vfs\vfsStreamAbstractContentTestCase

Test for org\bovigo\vfs\vfsStreamAbstractContent.

Hierarchy

Expanded class hierarchy of vfsStreamAbstractContentTestCase

File

vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamAbstractContentTestCase.php, line 40

Namespace

org\bovigo\vfs
View source
class vfsStreamAbstractContentTestCase extends \PHPUnit_Framework_TestCase {

  /**
   * @test
   * @group  permissions
   * @group  bug_15
   */
  public function noPermissionsForEveryone() {
    $abstractContent = new TestvfsStreamAbstractContent('foo', 00);
    $this
      ->assertFalse($abstractContent
      ->isReadable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, -1));
  }

  /**
   * @test
   * @group  permissions
   * @group  bug_15
   */
  public function executePermissionsForUser() {
    $abstractContent = new TestvfsStreamAbstractContent('foo', 0100);
    $this
      ->assertFalse($abstractContent
      ->isReadable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, -1));
    $this
      ->assertTrue($abstractContent
      ->isExecutable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, -1));
  }

  /**
   * @test
   * @group  permissions
   * @group  bug_15
   */
  public function executePermissionsForGroup() {
    $abstractContent = new TestvfsStreamAbstractContent('foo', 010);
    $this
      ->assertFalse($abstractContent
      ->isReadable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertTrue($abstractContent
      ->isExecutable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, -1));
  }

  /**
   * @test
   * @group  permissions
   * @group  bug_15
   */
  public function executePermissionsForOther() {
    $abstractContent = new TestvfsStreamAbstractContent('foo', 01);
    $this
      ->assertFalse($abstractContent
      ->isReadable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertTrue($abstractContent
      ->isExecutable(-1, -1));
  }

  /**
   * @test
   * @group  permissions
   * @group  bug_15
   */
  public function writePermissionsForUser() {
    $abstractContent = new TestvfsStreamAbstractContent('foo', 0200);
    $this
      ->assertFalse($abstractContent
      ->isReadable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, -1));
    $this
      ->assertTrue($abstractContent
      ->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, -1));
  }

  /**
   * @test
   * @group  permissions
   * @group  bug_15
   */
  public function writePermissionsForGroup() {
    $abstractContent = new TestvfsStreamAbstractContent('foo', 020);
    $this
      ->assertFalse($abstractContent
      ->isReadable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertTrue($abstractContent
      ->isWritable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, -1));
  }

  /**
   * @test
   * @group  permissions
   * @group  bug_15
   */
  public function writePermissionsForOther() {
    $abstractContent = new TestvfsStreamAbstractContent('foo', 02);
    $this
      ->assertFalse($abstractContent
      ->isReadable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertTrue($abstractContent
      ->isWritable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, -1));
  }

  /**
   * @test
   * @group  permissions
   * @group  bug_15
   */
  public function executeAndWritePermissionsForUser() {
    $abstractContent = new TestvfsStreamAbstractContent('foo', 0300);
    $this
      ->assertFalse($abstractContent
      ->isReadable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, -1));
    $this
      ->assertTrue($abstractContent
      ->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, -1));
    $this
      ->assertTrue($abstractContent
      ->isExecutable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, -1));
  }

  /**
   * @test
   * @group  permissions
   * @group  bug_15
   */
  public function executeAndWritePermissionsForGroup() {
    $abstractContent = new TestvfsStreamAbstractContent('foo', 030);
    $this
      ->assertFalse($abstractContent
      ->isReadable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertTrue($abstractContent
      ->isWritable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertTrue($abstractContent
      ->isExecutable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, -1));
  }

  /**
   * @test
   * @group  permissions
   * @group  bug_15
   */
  public function executeAndWritePermissionsForOther() {
    $abstractContent = new TestvfsStreamAbstractContent('foo', 03);
    $this
      ->assertFalse($abstractContent
      ->isReadable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertTrue($abstractContent
      ->isWritable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertTrue($abstractContent
      ->isExecutable(-1, -1));
  }

  /**
   * @test
   * @group  permissions
   * @group  bug_15
   */
  public function readPermissionsForUser() {
    $abstractContent = new TestvfsStreamAbstractContent('foo', 0400);
    $this
      ->assertTrue($abstractContent
      ->isReadable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, -1));
  }

  /**
   * @test
   * @group  permissions
   * @group  bug_15
   */
  public function readPermissionsForGroup() {
    $abstractContent = new TestvfsStreamAbstractContent('foo', 040);
    $this
      ->assertFalse($abstractContent
      ->isReadable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertTrue($abstractContent
      ->isReadable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, -1));
  }

  /**
   * @test
   * @group  permissions
   * @group  bug_15
   */
  public function readPermissionsForOther() {
    $abstractContent = new TestvfsStreamAbstractContent('foo', 04);
    $this
      ->assertFalse($abstractContent
      ->isReadable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertTrue($abstractContent
      ->isReadable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, -1));
  }

  /**
   * @test
   * @group  permissions
   * @group  bug_15
   */
  public function readAndExecutePermissionsForUser() {
    $abstractContent = new TestvfsStreamAbstractContent('foo', 0500);
    $this
      ->assertTrue($abstractContent
      ->isReadable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, -1));
    $this
      ->assertTrue($abstractContent
      ->isExecutable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, -1));
  }

  /**
   * @test
   * @group  permissions
   * @group  bug_15
   */
  public function readAndExecutePermissionsForGroup() {
    $abstractContent = new TestvfsStreamAbstractContent('foo', 050);
    $this
      ->assertFalse($abstractContent
      ->isReadable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertTrue($abstractContent
      ->isReadable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertTrue($abstractContent
      ->isExecutable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, -1));
  }

  /**
   * @test
   * @group  permissions
   * @group  bug_15
   */
  public function readAndExecutePermissionsForOther() {
    $abstractContent = new TestvfsStreamAbstractContent('foo', 05);
    $this
      ->assertFalse($abstractContent
      ->isReadable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertTrue($abstractContent
      ->isReadable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertTrue($abstractContent
      ->isExecutable(-1, -1));
  }

  /**
   * @test
   * @group  permissions
   * @group  bug_15
   */
  public function readAndWritePermissionsForUser() {
    $abstractContent = new TestvfsStreamAbstractContent('foo', 0600);
    $this
      ->assertTrue($abstractContent
      ->isReadable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, -1));
    $this
      ->assertTrue($abstractContent
      ->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, -1));
  }

  /**
   * @test
   * @group  permissions
   * @group  bug_15
   */
  public function readAndWritePermissionsForGroup() {
    $abstractContent = new TestvfsStreamAbstractContent('foo', 060);
    $this
      ->assertFalse($abstractContent
      ->isReadable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertTrue($abstractContent
      ->isReadable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertTrue($abstractContent
      ->isWritable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, -1));
  }

  /**
   * @test
   * @group  permissions
   * @group  bug_15
   */
  public function readAndWritePermissionsForOther() {
    $abstractContent = new TestvfsStreamAbstractContent('foo', 06);
    $this
      ->assertFalse($abstractContent
      ->isReadable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertTrue($abstractContent
      ->isReadable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertTrue($abstractContent
      ->isWritable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, -1));
  }

  /**
   * @test
   * @group  permissions
   * @group  bug_15
   */
  public function allPermissionsForUser() {
    $abstractContent = new TestvfsStreamAbstractContent('foo', 0700);
    $this
      ->assertTrue($abstractContent
      ->isReadable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, -1));
    $this
      ->assertTrue($abstractContent
      ->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, -1));
    $this
      ->assertTrue($abstractContent
      ->isExecutable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, -1));
  }

  /**
   * @test
   * @group  permissions
   * @group  bug_15
   */
  public function allPermissionsForGroup() {
    $abstractContent = new TestvfsStreamAbstractContent('foo', 070);
    $this
      ->assertFalse($abstractContent
      ->isReadable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertTrue($abstractContent
      ->isReadable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertTrue($abstractContent
      ->isWritable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertTrue($abstractContent
      ->isExecutable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, -1));
  }

  /**
   * @test
   * @group  permissions
   * @group  bug_15
   */
  public function allPermissionsForOther() {
    $abstractContent = new TestvfsStreamAbstractContent('foo', 07);
    $this
      ->assertFalse($abstractContent
      ->isReadable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isReadable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertTrue($abstractContent
      ->isReadable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isWritable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isWritable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertTrue($abstractContent
      ->isWritable(-1, -1));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(vfsStream::getCurrentUser(), vfsStream::getCurrentGroup()));
    $this
      ->assertFalse($abstractContent
      ->isExecutable(-1, vfsStream::getCurrentGroup()));
    $this
      ->assertTrue($abstractContent
      ->isExecutable(-1, -1));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
vfsStreamAbstractContentTestCase::allPermissionsForGroup public function @test @group permissions @group bug_15
vfsStreamAbstractContentTestCase::allPermissionsForOther public function @test @group permissions @group bug_15
vfsStreamAbstractContentTestCase::allPermissionsForUser public function @test @group permissions @group bug_15
vfsStreamAbstractContentTestCase::executeAndWritePermissionsForGroup public function @test @group permissions @group bug_15
vfsStreamAbstractContentTestCase::executeAndWritePermissionsForOther public function @test @group permissions @group bug_15
vfsStreamAbstractContentTestCase::executeAndWritePermissionsForUser public function @test @group permissions @group bug_15
vfsStreamAbstractContentTestCase::executePermissionsForGroup public function @test @group permissions @group bug_15
vfsStreamAbstractContentTestCase::executePermissionsForOther public function @test @group permissions @group bug_15
vfsStreamAbstractContentTestCase::executePermissionsForUser public function @test @group permissions @group bug_15
vfsStreamAbstractContentTestCase::noPermissionsForEveryone public function @test @group permissions @group bug_15
vfsStreamAbstractContentTestCase::readAndExecutePermissionsForGroup public function @test @group permissions @group bug_15
vfsStreamAbstractContentTestCase::readAndExecutePermissionsForOther public function @test @group permissions @group bug_15
vfsStreamAbstractContentTestCase::readAndExecutePermissionsForUser public function @test @group permissions @group bug_15
vfsStreamAbstractContentTestCase::readAndWritePermissionsForGroup public function @test @group permissions @group bug_15
vfsStreamAbstractContentTestCase::readAndWritePermissionsForOther public function @test @group permissions @group bug_15
vfsStreamAbstractContentTestCase::readAndWritePermissionsForUser public function @test @group permissions @group bug_15
vfsStreamAbstractContentTestCase::readPermissionsForGroup public function @test @group permissions @group bug_15
vfsStreamAbstractContentTestCase::readPermissionsForOther public function @test @group permissions @group bug_15
vfsStreamAbstractContentTestCase::readPermissionsForUser public function @test @group permissions @group bug_15
vfsStreamAbstractContentTestCase::writePermissionsForGroup public function @test @group permissions @group bug_15
vfsStreamAbstractContentTestCase::writePermissionsForOther public function @test @group permissions @group bug_15
vfsStreamAbstractContentTestCase::writePermissionsForUser public function @test @group permissions @group bug_15