org\bovigo\vfs\vfsStream::newFile PHP Method

newFile() public static method

returns a new file with given name
public static newFile ( string $name, integer $permissions = null ) : org\bovigo\vfs\vfsStreamFile
$name string name of file to create
$permissions integer permissions of file to create
return org\bovigo\vfs\vfsStreamFile
    public static function newFile($name, $permissions = null)
    {
        return new vfsStreamFile($name, $permissions);
    }

Usage Example

 /**
  * @since  3.0.0
  * @group  issue_58
  * @test
  */
 public function canEnableFileAnnotationCache()
 {
     $root = vfsStream::setup();
     $file = vfsStream::newFile('annotations.cache')->withContent(serialize($this->createdCachedAnnotation()))->at($root);
     persistAnnotationsInFile($file->url());
     assertTrue(AnnotationCache::has('foo', 'bar'));
 }
All Usage Examples Of org\bovigo\vfs\vfsStream::newFile