You are here

public function vfsStreamWrapperBaseTestCase::setUp in Zircon Profile 8

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

set up test environment

File

vendor/mikey179/vfsStream/src/test/php/org/bovigo/vfs/vfsStreamWrapperBaseTestCase.php, line 68

Class

vfsStreamWrapperBaseTestCase
Test for org\bovigo\vfs\vfsStreamWrapper.

Namespace

org\bovigo\vfs

Code

public function setUp() {
  $this->fooURL = vfsStream::url('foo');
  $this->barURL = vfsStream::url('foo/bar');
  $this->baz1URL = vfsStream::url('foo/bar/baz1');
  $this->baz2URL = vfsStream::url('foo/baz2');
  $this->foo = new vfsStreamDirectory('foo');
  $this->bar = new vfsStreamDirectory('bar');
  $this->baz1 = vfsStream::newFile('baz1')
    ->lastModified(300)
    ->lastAccessed(300)
    ->lastAttributeModified(300)
    ->withContent('baz 1');
  $this->baz2 = vfsStream::newFile('baz2')
    ->withContent('baz2')
    ->lastModified(400)
    ->lastAccessed(400)
    ->lastAttributeModified(400);
  $this->bar
    ->addChild($this->baz1);
  $this->foo
    ->addChild($this->bar);
  $this->foo
    ->addChild($this->baz2);
  $this->foo
    ->lastModified(100)
    ->lastAccessed(100)
    ->lastAttributeModified(100);
  $this->bar
    ->lastModified(200)
    ->lastAccessed(100)
    ->lastAttributeModified(100);
  vfsStreamWrapper::register();
  vfsStreamWrapper::setRoot($this->foo);
}