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