Localisation updates from https://translatewiki.net.
[mediawiki.git] / tests / phpunit / suites / SkinsUnitTestSuite.php
blob5e96f954dc52815f6c7f1eecd17d8d1f52d7da99
1 <?php
3 use PHPUnit\Framework\TestSuite;
4 use SebastianBergmann\FileIterator\Facade;
6 /**
7 * Test suite that runs skins unit tests (the `skins:unit` suite).
8 */
9 class SkinsUnitTestSuite extends TestSuite {
10 public function __construct() {
11 parent::__construct();
13 if ( !defined( 'MW_PHPUNIT_EXTENSIONS_PATHS' ) ) {
14 throw new RuntimeException( 'The PHPUnit bootstrap was not loaded' );
16 $paths = [];
17 foreach ( MW_PHPUNIT_EXTENSIONS_PATHS as $path ) {
18 // Note that we don't load settings, so we expect to find skins in their
19 // default location
20 // Standardize directory separators for Windows compatibility.
21 if ( str_contains( strtr( $path, '\\', '/' ), '/skins/' ) ) {
22 $paths[] = "$path/tests/phpunit/unit";
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 );
33 public static function suite() {
34 return new self;