Restored the ability to run extension tests from the main runner
[lhc/web/wiklou.git] / maintenance / tests / phpunit / suites / ExtensionsTestSuite.php
1 <?php
2 /**
3 * This test suite runs unit tests registered by extensions.
4 * See http://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 var_dump($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 PHPUnit_Framework_TestCase {
31 public function testNothing() {
32
33 }
34 }