Debian Codegraph @

tests/phpunit/suites/ExtensionsUnitTestSuite.php

raw symbols SCIP
1 <?php
2
3 use PHPUnit\Framework\TestSuite;
4 use SebastianBergmann\FileIterator\Facade;
5
6 /**
7 * Test suite that runs extensions unit tests (the `extensions:unit` suite).
8 */
9 class ExtensionsUnitTestSuite 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
17 $suffixes = [ 'Test.php' ];
18 $fileIterator = new Facade();
19 foreach ( MW_PHPUNIT_EXTENSIONS_PATHS as $path ) {
20 $this->addTestFiles( $fileIterator->getFilesAsArray( "$path/tests/phpunit/unit", $suffixes ) );
21 }
22 }
23
24 public static function suite() {
25 return new self;
26 }
27 }