Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Moving test files
<?php
function main($dir)
{
foreach(glob($dir.'/*') as $dir) {
// if this is a test file / folder
if(preg_match('/Test(.php)?/', $dir)) {
$newFile = "tests/VF" . str_replace('library/VF', '', $dir);
$newPath = dirname($newFile);
`mkdir -p $newPath`;
`mv $dir $newFile`;
continue;
}
if(is_dir($dir)) {
main($dir);
}
}
}
main('library/VF');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.