Merge "Fix typo"
[lhc/web/wiklou.git] / tests / phpunit / suites / ExtensionsTestSuite.php
1 <?php
2 /**
3 * This test suite runs unit tests registered by extensions.
4 * See https://www.mediawiki.org/wiki/Manual:Hooks/UnitTestsList for details of
5 * how to register your tests.
6 */
7
8 class ExtensionsTestSuite extends PHPUnit_Framework_TestSuite {
9 public function __construct() {
10 parent::__construct();
11 $files = array();
12 wfRunHooks( 'UnitTestsList', array( &$files ) );
13 foreach ( $files as $file ) {
14 $this->addTestFile( $file );
15 }
16 if ( !count( $files ) ) {
17 $this->addTest( new DummyExtensionsTest( 'testNothing' ) );
18 }
19 }
20
21 public static function suite() {
22 return new self;
23 }
24 }
25
26 /**
27 * Needed to avoid warnings like 'No tests found in class "ExtensionsTestSuite".'
28 * when no extensions with tests are used.
29 */
30 class DummyExtensionsTest extends MediaWikiTestCase {
31 public function testNothing() {
32 $this->assertTrue( true );
33 }
34 }