| Conditions | 6 |
| Paths | 5 |
| Total Lines | 20 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 6.105 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 17 | 1 | public function getSuites(string $folder): array |
|
| 18 | { |
||
| 19 | 1 | $suites = []; |
|
| 20 | 1 | $folder = (string) realpath($folder); |
|
| 21 | 1 | $classMap = require \findVendorDirectory() . "/composer/autoload_classmap.php"; |
|
| 22 | 1 | foreach ($classMap as $class => $file) { |
|
| 23 | 1 | $file = (string) realpath($file); |
|
| 24 | 1 | if (!str_starts_with($file, $folder)) { |
|
| 25 | 1 | continue; |
|
| 26 | } |
||
| 27 | try { |
||
| 28 | 1 | $reflection = new ReflectionClass($class); |
|
| 29 | } catch (ReflectionException $e) { |
||
| 30 | continue; |
||
| 31 | } |
||
| 32 | 1 | if (!$reflection->isAbstract() && $reflection->isSubclassOf(TestCase::class)) { |
|
| 33 | 1 | $suites[] = $reflection->getName(); |
|
| 34 | } |
||
| 35 | } |
||
| 36 | 1 | return $suites; |
|
| 37 | } |
||
| 39 |