Page MenuHomePhabricator

PHPUnit reports deprecation notice about mismatched test case class filename from GlobalFunctions tests
Closed, ResolvedPublic

Description

# php tests\phpunit\phpunit.php tests\phpunit\includes\GlobalFunctions
Using PHP 8.1.8
PHPUnit 9.5.28 by Sebastian Bergmann and contributors.

Warning:       Test case class not matching filename is deprecated
               in tests\phpunit\includes\GlobalFunctions\wfParseUrlTest.php
               Class name was 'WfParseUrlTest', expected 'wfParseUrlTest'
Warning:       Test case class not matching filename is deprecated
               in tests\phpunit\includes\GlobalFunctions\wfShellExecTest.php
               Class name was 'WfShellExecTest', expected 'wfShellExecTest'
Warning:       Test case class not matching filename is deprecated
               in tests\phpunit\includes\GlobalFunctions\wfThumbIsStandardTest.php
               Class name was 'WfThumbIsStandardTest', expected 'wfThumbIsStandardTest'

...............................................................  63 / 449 ( 14%)
................SSS............................................ 126 / 449 ( 28%)
............................................................... 189 / 449 ( 42%)
............................................................... 252 / 449 ( 56%)
............................................................... 315 / 449 ( 70%)
............................................................... 378 / 449 ( 84%)
.........................................................S..... 441 / 449 ( 98%)
........                                                        449 / 449 (100%)

Time: 00:05.186, Memory: 66.00 MB

OK, but incomplete, skipped, or risky tests!
Tests: 449, Assertions: 458, Skipped: 4.

Never seen on CI so this could just be a windows problem (handling file names case-insensitive)

https://github.com/sebastianbergmann/phpunit/commit/a1279f1d734f6fbd6a6e900f7a24b3b9767e9cac

Event Timeline

I'm seeing similar behavior in my environment on Linux:

~/src/wikimedia/core/tests/phpunit $ php phpunit.php unit/includes/GlobalFunctions/
Using PHP 8.1.19                                                     
PHPUnit 9.5.28 by Sebastian Bergmann and contributors.                                                                                    
                                                                                                                                          
Warning:       Test case class not matching filename is deprecated
               in /home/nik/src/wikimedia/core/tests/phpunit/unit/includes/GlobalFunctions/wfAppendQueryTest.php
               Class name was 'WfAppendQueryTest', expected 'wfAppendQueryTest'
Warning:       Test case class not matching filename is deprecated
               in /home/nik/src/wikimedia/core/tests/phpunit/unit/includes/GlobalFunctions/wfArrayPlus2dTest.php
               Class name was 'WfArrayPlus2dTest', expected 'wfArrayPlus2dTest' 
Warning:       Test case class not matching filename is deprecated                                                                        
               in /home/nik/src/wikimedia/core/tests/phpunit/unit/includes/GlobalFunctions/wfAssembleUrlTest.php
               Class name was 'WfAssembleUrlTest', expected 'wfAssembleUrlTest' 
Warning:       Test case class not matching filename is deprecated                                                                        
               in /home/nik/src/wikimedia/core/tests/phpunit/unit/includes/GlobalFunctions/wfBaseNameTest.php
               Class name was 'WfBaseNameTest', expected 'wfBaseNameTest'       
Warning:       Test case class not matching filename is deprecated

(etc.)

Change 929029 had a related patch set uploaded (by Nnyby; author: Nnyby):

[mediawiki/core@master] Resolve phpunit filename deprecation errors

https://gerrit.wikimedia.org/r/929029

Change 929029 merged by jenkins-bot:

[mediawiki/core@master] Resolve GlobalFunctions phpunit filename deprecation errors

https://gerrit.wikimedia.org/r/929029

Change 936383 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/core@master] tests: Resolve maintenance phpunit filename deprecation errors

https://gerrit.wikimedia.org/r/936383

Change 936383 merged by jenkins-bot:

[mediawiki/core@master] tests: Resolve maintenance phpunit filename deprecation errors

https://gerrit.wikimedia.org/r/936383

Change 948212 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/extensions/Flow@master] tests: Resolve phpunit filename deprecation errors

https://gerrit.wikimedia.org/r/948212

Change 948213 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/extensions/Echo@master] tests: Resolve phpunit filename deprecation errors

https://gerrit.wikimedia.org/r/948213

Change 948212 merged by jenkins-bot:

[mediawiki/extensions/Flow@master] tests: Resolve phpunit filename deprecation errors

https://gerrit.wikimedia.org/r/948212

Change 948213 merged by jenkins-bot:

[mediawiki/extensions/Echo@master] tests: Resolve phpunit filename deprecation errors

https://gerrit.wikimedia.org/r/948213