Merge "Fix wording of protect-cascadeon"
[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 how to register your tests.
5 */
6
7 class ExtensionsTestSuite extends PHPUnit_Framework_TestSuite {
8 public function __construct() {
9 parent::__construct();
10 $files = array();
11 wfRunHooks( 'UnitTestsList', array( &$files ) );
12 foreach ( $files as $file ) {
13 $this->addTestFile( $file );
14 }
15 if ( !count( $files ) ) {
16 $this->addTest( new DummyExtensionsTest( 'testNothing' ) );
17 }
18 }
19
20 public static function suite() {
21 return new self;
22 }
23 }
24
25 /**
26 * Needed to avoid warnings like 'No tests found in class "ExtensionsTestSuite".'
27 * when no extensions with tests are used.
28 */
29 class DummyExtensionsTest extends MediaWikiTestCase {
30 public function testNothing() {
31 $this->assertTrue( true );
32 }
33 }