From 4e330b4498073b5f9f1189c8b888020659cb538c Mon Sep 17 00:00:00 2001 From: mainframe98 Date: Sun, 1 Sep 2019 17:44:14 +0200 Subject: [PATCH] Permit case independent unit test directories If unit tests are namespaced under Tests/Unit/, with tests/phpunit being the PSR4 root Tests/, then the the unit test directory cannot be named unit/. The autoloader will not be able to find the files in that namespace, as it will be looking for the directory Unit/, not unit/. Change-Id: I8cf6cd31f22decb061650def9e1e5d8893dfa73f --- tests/phpunit/MediaWikiUnitTestCase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/MediaWikiUnitTestCase.php b/tests/phpunit/MediaWikiUnitTestCase.php index edd8195991..bb018aaf14 100644 --- a/tests/phpunit/MediaWikiUnitTestCase.php +++ b/tests/phpunit/MediaWikiUnitTestCase.php @@ -40,7 +40,7 @@ abstract class MediaWikiUnitTestCase extends TestCase { parent::setUp(); $reflection = new ReflectionClass( $this ); $dirSeparator = DIRECTORY_SEPARATOR; - if ( strpos( $reflection->getFilename(), "${dirSeparator}unit${dirSeparator}" ) === false ) { + if ( stripos( $reflection->getFilename(), "${dirSeparator}unit${dirSeparator}" ) === false ) { $this->fail( 'This unit test needs to be in "tests/phpunit/unit"!' ); } $this->unitGlobals = $GLOBALS; -- 2.20.1