| 1 |
<?php |
| 2 |
|
| 3 |
use PHPUnit\Framework\TestSuite; |
| 4 |
use SebastianBergmann\FileIterator\Facade; |
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
class SkinsUnitTestSuite extends TestSuite { |
| 10 |
public function __construct() { |
| 11 |
parent::__construct(); |
| 12 |
|
| 13 |
if ( !defined( 'MW_PHPUNIT_EXTENSIONS_PATHS' ) ) { |
| 14 |
throw new RuntimeException( 'The PHPUnit bootstrap was not loaded' ); |
| 15 |
} |
| 16 |
$paths = []; |
| 17 |
foreach ( MW_PHPUNIT_EXTENSIONS_PATHS as $path ) { |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
if ( str_contains( strtr( $path, '\\', '/' ), '/skins/' ) ) { |
| 22 |
$paths[] = "$path/tests/phpunit/unit"; |
| 23 |
} |
| 24 |
} |
| 25 |
foreach ( array_unique( $paths ) as $path ) { |
| 26 |
$suffixes = [ 'Test.php' ]; |
| 27 |
$fileIterator = new Facade(); |
| 28 |
$matchingFiles = $fileIterator->getFilesAsArray( $path, $suffixes ); |
| 29 |
$this->addTestFiles( $matchingFiles ); |
| 30 |
} |
| 31 |
} |
| 32 |
|
| 33 |
public static function suite() { |
| 34 |
return new self; |
| 35 |
} |
| 36 |
} |