ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilServicesLanguageSuite.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
24 
25 require_once __DIR__ . '/bootstrap.php';
26 
32 {
37  public static function suite(): self
38  {
39  $suite = new self();
40 
41  foreach (new RegExIterator(
43  new RecursiveDirectoryIterator(__DIR__, FilesystemIterator::SKIP_DOTS),
44  RecursiveIteratorIterator::LEAVES_ONLY
45  ),
46  '/BaseTest\.php$/'
47  ) as $file) {
49  require_once $file->getPathname();
50  }
51 
52  foreach (new RegExIterator(
54  new RecursiveDirectoryIterator(__DIR__, FilesystemIterator::SKIP_DOTS),
55  RecursiveIteratorIterator::LEAVES_ONLY
56  ),
57  '/(?<!Base)Test\.php$/'
58  ) as $file) {
60  require_once $file->getPathname();
61 
62  $className = preg_replace('/(.*?)(\.php)/', '$1', $file->getBasename());
63  if (class_exists($className)) {
64  $reflection = new ReflectionClass($className);
65  if (
66  !$reflection->isAbstract() &&
67  !$reflection->isInterface() &&
68  $reflection->isSubclassOf(TestCase::class)) {
69  $suite->addTestSuite($className);
70  }
71  }
72  }
73 
74  return $suite;
75  }
76 }
Class ilServicesLanguageSuite.