vendor/bin/phpunit extensions/MobileFrontend/tests/phpunit/integration/ results in
Error: Call to a member function getIP() on null in /Users/kharlan/src/mediawiki/includes/user/User.php on line 2260 Call Stack: 0.0146 395680 1. {main}() /Users/kharlan/src/mediawiki/vendor/phpunit/phpunit/phpunit:0 0.0923 2472248 2. PHPUnit\TextUI\Command::main(???) /Users/kharlan/src/mediawiki/vendor/phpunit/phpunit/phpunit:53 0.0923 2472360 3. PHPUnit\TextUI\Command->run(???, ???) /Users/kharlan/src/mediawiki/vendor/phpunit/phpunit/src/TextUI/Command.php:148 0.2045 5212448 4. PHPUnit\TextUI\TestRunner->getTest(???, ???, ???) /Users/kharlan/src/mediawiki/vendor/phpunit/phpunit/src/TextUI/Command.php:169 0.2197 5432688 5. PHPUnit\Framework\TestSuite->addTestFiles(???) /Users/kharlan/src/mediawiki/vendor/phpunit/phpunit/src/Runner/BaseTestRunner.php:65 0.2940 7734552 6. PHPUnit\Framework\TestSuite->addTestFile(???) /Users/kharlan/src/mediawiki/vendor/phpunit/phpunit/src/Framework/TestSuite.php:403 0.2959 7860032 7. PHPUnit\Framework\TestSuite->addTestSuite(???) /Users/kharlan/src/mediawiki/vendor/phpunit/phpunit/src/Framework/TestSuite.php:377 0.2959 7860288 8. PHPUnit\Framework\TestSuite->__construct(???, ???) /Users/kharlan/src/mediawiki/vendor/phpunit/phpunit/src/Framework/TestSuite.php:290 0.2962 7942568 9. PHPUnit\Framework\TestSuite->addTestMethod(???, ???) /Users/kharlan/src/mediawiki/vendor/phpunit/phpunit/src/Framework/TestSuite.php:187 0.2962 7942992 10. PHPUnit\Framework\TestSuite::createTest(???, ???) /Users/kharlan/src/mediawiki/vendor/phpunit/phpunit/src/Framework/TestSuite.php:882 0.2965 7947312 11. PHPUnit\Util\Test::getProvidedData(???, ???) /Users/kharlan/src/mediawiki/vendor/phpunit/phpunit/src/Framework/TestSuite.php:482 0.2966 7947440 12. PHPUnit\Util\Test::getDataFromDataProviderAnnotation(???, ???, ???) /Users/kharlan/src/mediawiki/vendor/phpunit/phpunit/src/Util/Test.php:449 0.2966 7950392 13. ReflectionMethod->invoke(???) /Users/kharlan/src/mediawiki/vendor/phpunit/phpunit/src/Util/Test.php:521 0.2966 7950392 14. MobileFormatterTest->provideHtmlTransform() /Users/kharlan/src/mediawiki/vendor/phpunit/phpunit/src/Util/Test.php:521 0.5278 16096424 15. MediaWiki\Session\SessionManager->shutdown() /Users/kharlan/src/mediawiki/includes/session/SessionManager.php:0 0.5279 16096424 16. MediaWiki\Session\SessionBackend->shutdown() /Users/kharlan/src/mediawiki/includes/session/SessionManager.php:449 0.5279 16096424 17. MediaWiki\Session\SessionBackend->save(???) /Users/kharlan/src/mediawiki/includes/session/SessionBackend.php:217 0.5281 16097120 18. User->getName() /Users/kharlan/src/mediawiki/includes/session/SessionBackend.php:734
while php tests/phpunit/phpunit.php extensions/MobileFrontend/tests/phpunit/integration/ works fine.
The line that triggers the problem is in extensions/MobileFrontend/tests/phpunit/integration/MobileFormatterTest.php, line 230, where we have wfMessage( 'mobile-frontend-missing-image' ) . ']</span>',. wfMessage() ends up getting to User.php:2260 where $this->getRequest() returns null.