<NME> DirectoryHelpers.php
<BEF> ADDFILE
<MSG> add Tests for Yaml- and XmlProvider

Former-commit-id: a682daa28041786835bc8ca1e5222f0c4e71f52b
Former-commit-id: 4faf7e1160eea6153da443c20dcdb09442e0079a
<DFF> @@ -0,0 +1,32 @@
+<?php
+namespace Concrete\Tests\Core\Database\Traits;
+
+/**
+ * @author Markus Liechti <markus@liechti.io>
+ */
+trait DirectoryHelpers
+{
+        /**
+     * Clean up and shorten absolut folder paths, 
+     * so they can be passed with assert methods
+     * 
+     * Example: 
+     * ....\htdocs\concrete5800/packages/test_metadatadriver_yaml\config\yaml
+     * will be converted to
+     * config/yaml
+     * 
+     * @param type $folderPath
+     * @return string
+     */
+    private function folderPathCleaner($folderPath)
+    {
+        //J:\xampp\htdocs\concrete5800/packages/test_metadatadriver_yaml\config\yaml
+        $folderPathCleaned = str_replace("\\", "/", $folderPath);
+
+        $linkParts = explode('/',rtrim($folderPathCleaned,'/'));
+        $count = count($linkParts);
+
+        $shortenedPath = $linkParts[$count-2].'/'.$linkParts[$count-1];
+        return $shortenedPath;
+    }
+}

{'addition_count': 32, 'commit_subject': 'add Tests for Yaml- and XmlProvider', 'deletion_count': 0, 'file_extension': '.php', 'lang': 'php', 'license': 'mit', 'repo_name': 'concrete5/concrete5'}