public function testWrite() { $empty = vfsStream::newFile('empty.txt', 0777); $this->root->addChild($empty); $file = new File($empty->url()); $file->write('PHPUNIT'); $this->assertEquals('PHPUNIT', file_get_contents($empty->url())); // test if overwrite works! $file->write('2PHPUNIT2'); $this->assertEquals('2PHPUNIT2', file_get_contents($empty->url())); }