From f87320bdac04cc8a45a7d1898973ec9079e0adfb Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Tue, 21 May 2013 11:26:02 +0200 Subject: [PATCH] tests: group structures tests in their own directory The phpunit root directory has two test file: AutoLoaderTest.php StructureTest.php The later was registered in phpunit under the `structure` test suite while the former was not registered and hence never run (bug 47750). This patch moves both files under the `structure` subdirectory and change the suite to look in that directory. That will avoid us having to manually maintain a list of test files. Updated the __DIR__ in StructureTest.php. Change-Id: I419c9157f32bdf7e1ff26a42f4bb3f3922b7be37 --- tests/phpunit/{ => structure}/AutoLoaderTest.php | 0 tests/phpunit/{ => structure}/StructureTest.php | 4 ++-- tests/phpunit/suite.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename tests/phpunit/{ => structure}/AutoLoaderTest.php (100%) rename tests/phpunit/{ => structure}/StructureTest.php (93%) diff --git a/tests/phpunit/AutoLoaderTest.php b/tests/phpunit/structure/AutoLoaderTest.php similarity index 100% rename from tests/phpunit/AutoLoaderTest.php rename to tests/phpunit/structure/AutoLoaderTest.php diff --git a/tests/phpunit/StructureTest.php b/tests/phpunit/structure/StructureTest.php similarity index 93% rename from tests/phpunit/StructureTest.php rename to tests/phpunit/structure/StructureTest.php index a9420981ec..df00d4df22 100644 --- a/tests/phpunit/StructureTest.php +++ b/tests/phpunit/structure/StructureTest.php @@ -14,7 +14,7 @@ class StructureTest extends MediaWikiTestCase { if ( wfIsWindows() ) { $this->markTestSkipped( 'This test does not work on Windows' ); } - $rootPath = escapeshellarg( __DIR__ ); + $rootPath = escapeshellarg( __DIR__ . '/..' ); $testClassRegex = implode( '|', array( 'ApiFormatTestBase', 'ApiTestCase', @@ -58,6 +58,6 @@ class StructureTest extends MediaWikiTestCase { * Filter to remove testUnitTestFileNamesEndWithTest false positives. */ public function filterSuites( $filename ) { - return strpos( $filename, __DIR__ . '/suites/' ) !== 0; + return strpos( $filename, __DIR__ . '/../suites/' ) !== 0; } } diff --git a/tests/phpunit/suite.xml b/tests/phpunit/suite.xml index 56f6447779..844c853510 100644 --- a/tests/phpunit/suite.xml +++ b/tests/phpunit/suite.xml @@ -29,7 +29,7 @@ maintenance - StructureTest.php + structure suites/UploadFromUrlTestSuite.php -- 2.20.1