Conditions | 4 |
Paths | 4 |
Total Lines | 21 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 16 |
CRAP Score | 4.0032 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | 1 | public function getSuites(string $folder): array |
|
18 | { |
||
19 | 1 | if (!$this->isAvailable()) { |
|
20 | return []; |
||
21 | } |
||
22 | 1 | $suites = []; |
|
23 | 1 | $robot = new RobotLoader(); |
|
24 | 1 | $tempDir = "$folder/temp/cache/Robot.Loader"; |
|
25 | 1 | FileSystem::createDir($tempDir); |
|
26 | 1 | $robot->setTempDirectory($tempDir); |
|
27 | 1 | $robot->addDirectory($folder); |
|
28 | 1 | $robot->acceptFiles = ["*" . static::FILENAME_SUFFIX, ]; |
|
29 | 1 | $robot->rebuild(); |
|
30 | 1 | $robot->register(); |
|
31 | 1 | $classes = $robot->getIndexedClasses(); |
|
32 | 1 | foreach ($classes as $class => $file) { |
|
33 | 1 | if ($this->isTestSuite($class)) { |
|
34 | 1 | $suites[] = $class; |
|
35 | } |
||
36 | } |
||
37 | 1 | return $suites; |
|
38 | } |
||
45 |