summaryrefslogtreecommitdiff
path: root/tests/phpunit/StructureTest.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2013-12-08 09:55:49 +0100
committerPierre Schmitz <pierre@archlinux.de>2013-12-08 09:55:49 +0100
commit4ac9fa081a7c045f6a9f1cfc529d82423f485b2e (patch)
treeaf68743f2f4a47d13f2b0eb05f5c4aaf86d8ea37 /tests/phpunit/StructureTest.php
parentaf4da56f1ad4d3ef7b06557bae365da2ea27a897 (diff)
Update to MediaWiki 1.22.0
Diffstat (limited to 'tests/phpunit/StructureTest.php')
-rw-r--r--tests/phpunit/StructureTest.php63
1 files changed, 0 insertions, 63 deletions
diff --git a/tests/phpunit/StructureTest.php b/tests/phpunit/StructureTest.php
deleted file mode 100644
index a9420981..00000000
--- a/tests/phpunit/StructureTest.php
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-/**
- * The tests here verify the structure of the code. This is for outright bugs,
- * not just style issues.
- */
-
-class StructureTest extends MediaWikiTestCase {
- /**
- * 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() ) {
- $this->markTestSkipped( 'This test does not work on Windows' );
- }
- $rootPath = escapeshellarg( __DIR__ );
- $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'" .
- " | xargs grep -El '$testClassRegex|function suite\('";
-
- $results = null;
- $exitCode = null;
- exec( $finder, $results, $exitCode );
-
- $this->assertEquals(
- 0,
- $exitCode,
- 'Verify find/grep command succeeds.'
- );
-
- $results = array_filter(
- $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 in $rootPath must end with Test."
- );
- }
-
- /**
- * Filter to remove testUnitTestFileNamesEndWithTest false positives.
- */
- public function filterSuites( $filename ) {
- return strpos( $filename, __DIR__ . '/suites/' ) !== 0;
- }
-}