ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilServicesUserSuite.php
Go to the documentation of this file.
1 <?php
20 
22 {
23  public static function suite(): self
24  {
25  $suite = new ilServicesUserSuite();
26 
27  foreach (new RegExIterator(
29  new RecursiveDirectoryIterator(__DIR__, FilesystemIterator::SKIP_DOTS),
30  RecursiveIteratorIterator::LEAVES_ONLY
31  ),
32  '/BaseTest\.php$/'
33  ) as $file) {
35  require_once $file->getPathname();
36  }
37 
38  foreach (new RegExIterator(
40  new RecursiveDirectoryIterator(__DIR__, FilesystemIterator::SKIP_DOTS),
41  RecursiveIteratorIterator::LEAVES_ONLY
42  ),
43  '/(?<!Base)Test\.php$/'
44  ) as $file) {
46  require_once $file->getPathname();
47 
48  $className = preg_replace('/(.*?)(\.php)/', '$1', $file->getBasename());
49  if (class_exists($className)) {
50  $reflection = new ReflectionClass($className);
51  if (
52  !$reflection->isAbstract() &&
53  !$reflection->isInterface() &&
54  $reflection->isSubclassOf(TestCase::class)) {
55  $suite->addTestSuite($className);
56  }
57  }
58  }
59  return $suite;
60  }
61 }