MediaWiki  1.23.2
StructureTest.php
Go to the documentation of this file.
1 <?php
14  if ( wfIsWindows() ) {
15  $this->markTestSkipped( 'This test does not work on Windows' );
16  }
17  $rootPath = escapeshellarg( __DIR__ . '/..' );
18  $testClassRegex = implode( '|', array(
19  'ApiFormatTestBase',
20  'ApiTestCase',
21  'ApiQueryTestBase',
22  'ApiQueryContinueTestBase',
23  'MediaWikiLangTestCase',
24  'MediaWikiTestCase',
25  'ResourceLoaderTestCase',
26  'PHPUnit_Framework_TestCase',
27  'DumpTestCase',
28  ) );
29  $testClassRegex = "^class .* extends ($testClassRegex)";
30  $finder = "find $rootPath -name '*.php' '!' -name '*Test.php'" .
31  " | xargs grep -El '$testClassRegex|function suite\('";
32 
33  $results = null;
34  $exitCode = null;
35  exec( $finder, $results, $exitCode );
36 
37  $this->assertEquals(
38  0,
39  $exitCode,
40  'Verify find/grep command succeeds.'
41  );
42 
43  $results = array_filter(
44  $results,
45  array( $this, 'filterSuites' )
46  );
47  $strip = strlen( $rootPath ) - 1;
48  foreach ( $results as $k => $v ) {
49  $results[$k] = substr( $v, $strip );
50  }
51  $this->assertEquals(
52  array(),
53  $results,
54  "Unit test file in $rootPath must end with Test."
55  );
56  }
57 
61  public function filterSuites( $filename ) {
62  return strpos( $filename, __DIR__ . '/../suites/' ) !== 0;
63  }
64 }
php
skin txt MediaWiki includes four core it has been set as the default in MediaWiki since the replacing Monobook it had been been the default skin since before being replaced by Vector largely rewritten in while keeping its appearance Several legacy skins were removed in the as the burden of supporting them became too heavy to bear Those in etc for skin dependent CSS etc for skin dependent JavaScript These can also be customised on a per user by etc This feature has led to a wide variety of user styles becoming that gallery is a good place to ending in php
Definition: skin.txt:62
MediaWikiTestCase
Definition: MediaWikiTestCase.php:6
array
the array() calling protocol came about after MediaWiki 1.4rc1.
List of Api Query prop modules.
wfIsWindows
wfIsWindows()
Check if the operating system is Windows.
Definition: GlobalFunctions.php:2524
StructureTest
The tests here verify the structure of the code.
Definition: StructureTest.php:7
StructureTest\filterSuites
filterSuites( $filename)
Filter to remove testUnitTestFileNamesEndWithTest false positives.
Definition: StructureTest.php:61
as
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
Definition: distributors.txt:9
StructureTest\testUnitTestFileNamesEndWithTest
testUnitTestFileNamesEndWithTest()
Verify all files that appear to be tests have file names ending in Test.
Definition: StructureTest.php:13