ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilServicesLTISuite.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
23 
29 {
34  public static function suite(): self
35  {
36  $suite = new self();
37 
38  foreach (new RegExIterator(
40  new RecursiveDirectoryIterator(__DIR__, FilesystemIterator::SKIP_DOTS),
41  RecursiveIteratorIterator::LEAVES_ONLY
42  ),
43  '/BaseTest\.php$/'
44  ) as $file) {
45  }
46 
47  foreach (new RegExIterator(
49  new RecursiveDirectoryIterator(__DIR__, FilesystemIterator::SKIP_DOTS),
50  RecursiveIteratorIterator::LEAVES_ONLY
51  ),
52  '/(?<!Base)Test\.php$/'
53  ) as $file) {
54  $className = preg_replace('/(.*?)(\.php)/', '$1', $file->getBasename());
55  if (class_exists($className)) {
56  $reflection = new ReflectionClass($className);
57  if (
58  !$reflection->isAbstract() &&
59  !$reflection->isInterface() &&
60  $reflection->isSubclassOf(TestCase::class)) {
61  $suite->addTestSuite($className);
62  }
63  }
64  }
65  return $suite;
66  }
67 }
Class ilServicesLTISuite.