]> git.mxchange.org Git - friendica.git/blobdiff - tests/Util/VFSTrait.php
Merge pull request #6638 from Ixiter/develop-markdown-anchors
[friendica.git] / tests / Util / VFSTrait.php
index b0e7a3a60434c678d734382efcd5e4c76f2418cf..320d989cce04c093accffdec897814fc54c72528 100644 (file)
@@ -13,22 +13,31 @@ trait VFSTrait
         */
        protected $root;
 
+       /**
+        * Sets up the Virtual File System for Friendica with common files (config, dbstructure)
+        */
        protected function setUpVfsDir() {
                // the used directories inside the App class
                $structure = [
                        'config' => [],
-                       'bin' => []
+                       'bin' => [],
+                       'test' => []
                ];
 
                // create a virtual directory and copy all needed files and folders to it
                $this->root = vfsStream::setup('friendica', null, $structure);
 
-               $this->setConfigFile('config.ini.php');
-               $this->setConfigFile('settings.ini.php');
-               $this->setConfigFile('local.ini.php');
-               $this->setConfigFile('dbstructure.json');
+               $this->setConfigFile('defaults.config.php');
+               $this->setConfigFile('settings.config.php');
+               $this->setConfigFile('local.config.php');
+               $this->setConfigFile('dbstructure.config.php');
        }
 
+       /**
+        * Copying a config file from the file system to the Virtual File System
+        *
+        * @param string $filename The filename of the config file
+        */
        protected function setConfigFile($filename)
        {
                $file = dirname(__DIR__) . DIRECTORY_SEPARATOR .
@@ -43,10 +52,15 @@ trait VFSTrait
                }
        }
 
+       /**
+        * Delets a config file from the Virtual File System
+        *
+        * @param string $filename The filename of the config file
+        */
        protected function delConfigFile($filename)
        {
                if ($this->root->hasChild('config/' . $filename)) {
-                       $this->root->removeChild('config/' . $filename);
+                       $this->root->getChild('config')->removeChild($filename);
                }
        }
 }