zhamao-framework/tests/Trait/HasVirtualFileSystem.php

19 lines
357 B
PHP
Raw Normal View History

2022-12-23 20:22:43 +08:00
<?php
declare(strict_types=1);
namespace Tests\Trait;
use org\bovigo\vfs\vfsStream;
use org\bovigo\vfs\vfsStreamDirectory;
trait HasVirtualFileSystem
{
private vfsStreamDirectory $vfs;
2022-12-24 15:46:13 +08:00
private function setUpVfs(string $dir = 'root', array $structure = []): void
2022-12-23 20:22:43 +08:00
{
2022-12-24 15:46:13 +08:00
$this->vfs = vfsStream::setup($dir, structure: $structure);
2022-12-23 20:22:43 +08:00
}
}