From: Hashar Date: Mon, 25 Jun 2018 12:38:07 +0000 (+0000) Subject: Revert "Use pathinfo() in AutoLoaderStructureTest::testPSR4Completeness" X-Git-Tag: 1.34.0-rc.0~4973^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%29%20.%20%22?a=commitdiff_plain;h=afb2269cb95d1c09291515c5f72c4e425ec999ac;p=lhc%2Fweb%2Fwiklou.git Revert "Use pathinfo() in AutoLoaderStructureTest::testPSR4Completeness" This reverts commit 634c2ec2afd93827e5aaf571396eb76d35948188. Reason for revert: that strips the PSR4 directories from the class. Example: $dir BlueSpiceFoundation/src/" $file BlueSpiceFoundation/src/ConfigDefinition/IntSetting.php $abbrFileName: IntSetting $expectedClassName: BlueSpice\IntSetting $abbrFileName should be relative to $dir and not just the filename. Bug: T198077 Change-Id: Ie934e309fee0392439b4e26d86249f0650e5ea67 --- diff --git a/tests/phpunit/structure/AutoLoaderStructureTest.php b/tests/phpunit/structure/AutoLoaderStructureTest.php index 7163916225..2800d021f8 100644 --- a/tests/phpunit/structure/AutoLoaderStructureTest.php +++ b/tests/phpunit/structure/AutoLoaderStructureTest.php @@ -46,7 +46,7 @@ class AutoLoaderStructureTest extends MediaWikiTestCase { // Check that the expected class name (based on the filename) is the // same as the one we found. // Strip directory prefix from front of filename, and .php extension - $abbrFileName = pathinfo( $file, PATHINFO_FILENAME ); + $abbrFileName = substr( substr( $file, strlen( $dir ) ), 0, -4 ); $expectedClassName = $prefix . str_replace( '/', '\\', $abbrFileName ); $this->assertSame(