Fixed constructing job file list in tests
This commit is contained in:
parent
186a680e98
commit
331691e332
1 changed files with 6 additions and 1 deletions
|
@ -19,7 +19,12 @@ abstract class AbstractFullApiTest extends AbstractTest
|
|||
|
||||
protected function getAllJobs()
|
||||
{
|
||||
$files = glob(getConfig()->rootDir . DS . 'src' . DS . 'Api' . DS . 'Jobs' . DS . '*.php');
|
||||
$pathToJobs = getConfig()->rootDir . DS . 'src' . DS . 'Api' . DS . 'Jobs';
|
||||
$directory = new RecursiveDirectoryIterator($pathToJobs);
|
||||
$iterator = new RecursiveIteratorIterator($directory);
|
||||
$regex = new RegexIterator($iterator, '/^.+Job\.php$/i');
|
||||
$files = array_keys(iterator_to_array($regex));
|
||||
|
||||
\Chibi\Util\Reflection::loadClasses($files);
|
||||
return array_filter(get_declared_classes(), function($x)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue