ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilServicesCertificateSuite.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3 require_once __DIR__ . '/bootstrap.php';
8 {
12  public static function suite()
13  {
14  $suite = new self();
15 
16  foreach (new \RegExIterator(
18  new \RecursiveDirectoryIterator(__DIR__, \FilesystemIterator::SKIP_DOTS),
19  \RecursiveIteratorIterator::LEAVES_ONLY
20  ),
21  '/(?<!Base)Test\.php$/'
22  ) as $file) {
24  require_once $file->getPathname();
25  $className = preg_replace('/(.*?)(\.php)/', '$1', $file->getBasename());
26  if (class_exists($className)) {
27  $reflection = new \ReflectionClass($className);
28  if (
29  !$reflection->isAbstract() &&
30  !$reflection->isInterface() &&
31  $reflection->isSubclassOf(\PHPUnit_Framework_TestCase::class)) {
32  $suite->addTestSuite($className);
33  }
34  }
35  }
36 
37  return $suite;
38  }
39 }
$suite