4 require( dirname( __FILE__
) . '/../commandLine.inc' );
5 require 'PHPUnit/TextUI/Command.php';
6 define( 'MW_PHPUNIT_TEST', 1 );
8 $wgLocaltimezone = 'UTC';
10 /* Tests were failing with sqlite */
12 $wgCaches[CACHE_DB
] = false;
14 if ( !version_compare( PHPUnit_Runner_Version
::id(), "3.4.1", ">" ) ) {
16 ************************************************************
18 These tests run best with version PHPUnit 3.4.2 or later.
19 Earlier versions may show failures because earlier versions
20 of PHPUnit do not properly implement dependencies.
22 ************************************************************
27 class MWPHPUnitCommand
extends PHPUnit_TextUI_Command
{
28 protected function handleCustomTestSuite() {
29 $suite = new PHPUnit_Framework_TestSuite
;
30 if ( !empty( $this->options
[1] ) ) {
31 $files = $this->options
[1];
33 require( dirname( __FILE__
) . '/TestFileList.php' );
35 wfRunHooks( 'UnitTestsList', array( &$files ) );
37 foreach ( $files as $file ) {
38 $suite->addTestFile( $file );
40 $suite->setName( 'MediaWiki test suite' );
41 $this->arguments
['test'] = $suite;
45 $command = new MWPHPUnitCommand
;
46 $command->run( $argv );