3 namespace Friendica\Test\Util;
6 use org\bovigo\vfs\vfsStream;
7 use org\bovigo\vfs\vfsStreamDirectory;
12 * @var vfsStreamDirectory The Stream Directory
16 protected function setUpVfsDir() {
17 // the used directories inside the App class
23 // create a virtual directory and copy all needed files and folders to it
24 $this->root = vfsStream::setup('friendica', null, $structure);
26 $this->setConfigFile('config.ini.php');
27 $this->setConfigFile('settings.ini.php');
28 $this->setConfigFile('local.ini.php');
29 $this->setConfigFile('dbstructure.json');
32 protected function setConfigFile($filename)
34 $file = dirname(__DIR__) . DIRECTORY_SEPARATOR .
35 '..' . DIRECTORY_SEPARATOR .
36 'config' . DIRECTORY_SEPARATOR .
39 if (file_exists($file)) {
40 vfsStream::newFile($filename)
41 ->at($this->root->getChild('config'))
42 ->setContent(file_get_contents($file));
46 protected function delConfigFile($filename)
48 if ($this->root->hasChild('config/' . $filename)) {
49 $this->root->removeChild('config/' . $filename);