Index: trunk/phase3/maintenance/tests/phpunit |
— | — | @@ -1,54 +0,0 @@ |
2 | | -#!/usr/bin/env php |
3 | | -<?php |
4 | | - |
5 | | -require( dirname( __FILE__ ) . '/../commandLine.inc' ); |
6 | | -// XXX: This can go away if everyone switches to PHPUnit 3.5 |
7 | | -if ( @file_get_contents( 'PHPUnit/Autoload.php', true ) !== false ) { |
8 | | - // Works for PHPUnit >= 3.5 |
9 | | - require_once 'PHPUnit/Autoload.php'; |
10 | | -} else { |
11 | | - // Works for PHPUnit < 3.5 |
12 | | - require_once 'PHPUnit/TextUI/Command.php'; |
13 | | -} |
14 | | -define( 'MW_PHPUNIT_TEST', 1 ); |
15 | | - |
16 | | -$wgLocaltimezone = 'UTC'; |
17 | | - |
18 | | -/* Tests were failing with sqlite */ |
19 | | -global $wgCaches; |
20 | | -$wgCaches[CACHE_DB] = false; |
21 | | - |
22 | | -if ( !version_compare( PHPUnit_Runner_Version::id(), "3.4.1", ">" ) ) { |
23 | | - echo <<<EOF |
24 | | -************************************************************ |
25 | | - |
26 | | -These tests run best with version PHPUnit 3.4.2 or later. |
27 | | -Earlier versions may show failures because earlier versions |
28 | | -of PHPUnit do not properly implement dependencies. |
29 | | - |
30 | | -************************************************************ |
31 | | - |
32 | | -EOF; |
33 | | -} |
34 | | - |
35 | | -class MWPHPUnitCommand extends PHPUnit_TextUI_Command { |
36 | | - protected function handleCustomTestSuite() { |
37 | | - $suite = new PHPUnit_Framework_TestSuite; |
38 | | - if ( !empty( $this->options[1] ) ) { |
39 | | - $files = $this->options[1]; |
40 | | - } else { |
41 | | - require( dirname( __FILE__ ) . '/TestFileList.php' ); |
42 | | - $files = $testFiles; |
43 | | - wfRunHooks( 'UnitTestsList', array( &$files ) ); |
44 | | - } |
45 | | - foreach ( $files as $file ) { |
46 | | - $suite->addTestFile( $file ); |
47 | | - } |
48 | | - $suite->setName( 'MediaWiki test suite' ); |
49 | | - $this->arguments['test'] = $suite; |
50 | | - } |
51 | | -} |
52 | | - |
53 | | -$command = new MWPHPUnitCommand; |
54 | | -$command->run( $argv ); |
55 | | - |
Index: trunk/phase3/maintenance/tests/Makefile |
— | — | @@ -8,16 +8,16 @@ |
9 | 9 | all test: phpunit |
10 | 10 | |
11 | 11 | phpunit: |
12 | | - php phpunit |
| 12 | + php phpunit.php |
13 | 13 | |
14 | 14 | tap: |
15 | | - prove -e 'php phpunit --tap' *Test*.php |
| 15 | + prove -e 'php phpunit.php --tap' *Test*.php |
16 | 16 | |
17 | 17 | separate: $(TEST_FILE_TARGETS) |
18 | 18 | |
19 | 19 | # Need --tap because without it, the target specification doesn't work |
20 | 20 | $(TEST_FILE_TARGETS) : %.target : %.php |
21 | | - php phpunit --tap $< |
| 21 | + php phpunit.php --tap $< |
22 | 22 | |
23 | 23 | install: |
24 | 24 | pear channel-discover pear.phpunit.de |
Index: trunk/phase3/maintenance/tests/phpunit.php |
— | — | @@ -0,0 +1,54 @@ |
| 2 | +#!/usr/bin/env php |
| 3 | +<?php |
| 4 | + |
| 5 | +require( dirname( __FILE__ ) . '/../commandLine.inc' ); |
| 6 | +// XXX: This can go away if everyone switches to PHPUnit 3.5 |
| 7 | +if ( @file_get_contents( 'PHPUnit/Autoload.php', true ) !== false ) { |
| 8 | + // Works for PHPUnit >= 3.5 |
| 9 | + require_once 'PHPUnit/Autoload.php'; |
| 10 | +} else { |
| 11 | + // Works for PHPUnit < 3.5 |
| 12 | + require_once 'PHPUnit/TextUI/Command.php'; |
| 13 | +} |
| 14 | +define( 'MW_PHPUNIT_TEST', 1 ); |
| 15 | + |
| 16 | +$wgLocaltimezone = 'UTC'; |
| 17 | + |
| 18 | +/* Tests were failing with sqlite */ |
| 19 | +global $wgCaches; |
| 20 | +$wgCaches[CACHE_DB] = false; |
| 21 | + |
| 22 | +if ( !version_compare( PHPUnit_Runner_Version::id(), "3.4.1", ">" ) ) { |
| 23 | + echo <<<EOF |
| 24 | +************************************************************ |
| 25 | + |
| 26 | +These tests run best with version PHPUnit 3.4.2 or later. |
| 27 | +Earlier versions may show failures because earlier versions |
| 28 | +of PHPUnit do not properly implement dependencies. |
| 29 | + |
| 30 | +************************************************************ |
| 31 | + |
| 32 | +EOF; |
| 33 | +} |
| 34 | + |
| 35 | +class MWPHPUnitCommand extends PHPUnit_TextUI_Command { |
| 36 | + protected function handleCustomTestSuite() { |
| 37 | + $suite = new PHPUnit_Framework_TestSuite; |
| 38 | + if ( !empty( $this->options[1] ) ) { |
| 39 | + $files = $this->options[1]; |
| 40 | + } else { |
| 41 | + require( dirname( __FILE__ ) . '/TestFileList.php' ); |
| 42 | + $files = $testFiles; |
| 43 | + wfRunHooks( 'UnitTestsList', array( &$files ) ); |
| 44 | + } |
| 45 | + foreach ( $files as $file ) { |
| 46 | + $suite->addTestFile( $file ); |
| 47 | + } |
| 48 | + $suite->setName( 'MediaWiki test suite' ); |
| 49 | + $this->arguments['test'] = $suite; |
| 50 | + } |
| 51 | +} |
| 52 | + |
| 53 | +$command = new MWPHPUnitCommand; |
| 54 | +$command->run( $argv ); |
| 55 | + |
Property changes on: trunk/phase3/maintenance/tests/phpunit.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 56 | + native |
Added: svn:executable |
2 | 57 | + * |