Last active
July 26, 2018 05:29
-
-
Save ScopeyNZ/8e28c5f29f2269537ecb41c035868ce7 to your computer and use it in GitHub Desktop.
Show the modules that are installed that aren't part of a test suite (for use with recipes)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$lock = json_decode(file_get_contents("composer.lock"), true); | |
$testXML = file_get_contents('phpunit.xml.dist'); | |
foreach ($lock['packages'] as $package) { | |
if (strpos($package['type'], 'silverstripe') !== false && strpos($testXML, $package['name']) === false) { | |
// Attempt to locate a test folder | |
$directory = 'vendor' . DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $package['name']). DIRECTORY_SEPARATOR; | |
if (is_dir($directory) && is_dir($directory .'tests')) { | |
echo $package['name'].PHP_EOL; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment