ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilServicesTermsOfServiceSuite.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once __DIR__ . '/bootstrap.php';
5 
11 {
15  public static function suite()
16  {
17  $suite = new self();
18 
19  foreach (new \RegExIterator(
21  new \RecursiveDirectoryIterator(__DIR__, \FilesystemIterator::SKIP_DOTS),
22  \RecursiveIteratorIterator::LEAVES_ONLY
23  ),
24  '/BaseTest\.php$/'
25  ) as $file) {
27  require_once $file->getPathname();
28  }
29 
30  foreach (new \RegExIterator(
32  new \RecursiveDirectoryIterator(__DIR__, \FilesystemIterator::SKIP_DOTS),
33  \RecursiveIteratorIterator::LEAVES_ONLY
34  ),
35  '/(?<!Base)Test\.php$/'
36  ) as $file) {
38  require_once $file->getPathname();
39 
40  $className = preg_replace('/(.*?)(\.php)/', '$1', $file->getBasename());
41  if (class_exists($className)) {
42  $reflection = new \ReflectionClass($className);
43  if (
44  !$reflection->isAbstract() &&
45  !$reflection->isInterface() &&
46  $reflection->isSubclassOf(\PHPUnit_Framework_TestCase::class)) {
47  $suite->addTestSuite($className);
48  }
49  }
50  }
51 
52  return $suite;
53  }
54 }
$suite
Class ilServicesTermsOfServiceSuite.