/**
* Verify all files that appear to be tests have file names ending in
* Test. If the file names do not end in Test, they will not be run.
+ * @group medium
*/
public function testUnitTestFileNamesEndWithTest() {
if ( wfIsWindows() ) {
$testClassRegex = implode( '|', array(
'ApiFormatTestBase',
'ApiTestCase',
+ 'ApiQueryTestBase',
+ 'ApiQueryContinueTestBase',
'MediaWikiLangTestCase',
'MediaWikiTestCase',
'PHPUnit_Framework_TestCase',
+ 'DumpTestCase',
) );
$testClassRegex = "^class .* extends ($testClassRegex)";
$finder = "find $rootPath -name '*.php' '!' -name '*Test.php'" .
$results = null;
$exitCode = null;
- exec($finder, $results, $exitCode);
+ exec( $finder, $results, $exitCode );
$this->assertEquals(
0,
$results,
array( $this, 'filterSuites' )
);
-
+ $strip = strlen( $rootPath ) - 1;
+ foreach ( $results as $k => $v ) {
+ $results[$k] = substr( $v, $strip );
+ }
$this->assertEquals(
array(),
$results,
- 'Unit test file names must end with Test.'
+ "Unit test file in $rootPath must end with Test."
);
}