generate:travis-yml was looking for test files in plugins, but it was looking in
tests/*/*Test.php. And of course, for plugins that had plugins in a 3 level deep subdirectory (i.e.
tests/*/*/*Test.php) the command was failing because no tests were found. This is the case for example for the ActivityLog plugin.
I could have fixed it by adding another test to the list (because
glob() doesn't match recursively):
$testFiles = array_merge(glob($folderPath . "/*/*Test.php"), glob($folderPath . "/*Test.php"), glob($folderPath . "/*/*/*Test.php")); return !empty($testFiles);
But this is not really ideal, so instead of writing useless complex code I went with using Symfony's Finder component:
$finder = new Finder(); $finder->files() ->in($folderPath) ->name('*Test.php'); return count($finder) > 0;
So that's the reason I'm opening a pull request: do you think that's fine to introduce a new dependency to that component? I've been using the Finder for a while in other projects and it's really useful, I'm guessing it could be reused in many places in Piwik.
because glob() doesn't match recursively
globr would help here? http://developer.piwik.org/api-reference/Piwik/Filesystem#globr