diff options
author | RazeSoldier <razesoldier@outlook.com> | 2019-07-18 01:52:18 +0800 |
---|---|---|
committer | Jforrester <jforrester@wikimedia.org> | 2019-07-19 19:45:30 +0000 |
commit | d94906eaa20ccb0d36277d1172dba8f512c6497f (patch) | |
tree | 812540d1b38bd97d4d0f0f2cf4849d81ae04ade7 /tests/phpunit/MediaWikiUnitTestCase.php | |
parent | 5c771bda882791647922d00d39bf95b60bdad9ae (diff) | |
download | mediawikicore-d94906eaa20ccb0d36277d1172dba8f512c6497f.tar.gz mediawikicore-d94906eaa20ccb0d36277d1172dba8f512c6497f.zip |
MediaWikiUnitTestCase: Use DIRECTORY_SEPARATOR instead of `/`
`strpos( $reflection->getFilename(), '/unit/' )` will always
return FALSE under Windows
Change-Id: Ib13d32858e238b9a18094f829939f6bba08366ab
Diffstat (limited to 'tests/phpunit/MediaWikiUnitTestCase.php')
-rw-r--r-- | tests/phpunit/MediaWikiUnitTestCase.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/phpunit/MediaWikiUnitTestCase.php b/tests/phpunit/MediaWikiUnitTestCase.php index 43a333cb885e..5f7746b3e631 100644 --- a/tests/phpunit/MediaWikiUnitTestCase.php +++ b/tests/phpunit/MediaWikiUnitTestCase.php @@ -36,7 +36,8 @@ abstract class MediaWikiUnitTestCase extends TestCase { protected function setUp() { parent::setUp(); $reflection = new ReflectionClass( $this ); - if ( strpos( $reflection->getFilename(), '/unit/' ) === false ) { + $dirSeparator = DIRECTORY_SEPARATOR; + if ( strpos( $reflection->getFilename(), "${dirSeparator}unit${dirSeparator}" ) === false ) { $this->fail( 'This unit test needs to be in "tests/phpunit/unit" !' ); } $this->unitGlobals = $GLOBALS; |