I have been running unit tests with master versions of core BetaFeatures and OATHAuth. I am given a fatal error:
$ /bin/ls -1 extensions
BetaFeatures
OATHAuth
$
$ php tests/phpunit/phpunit.php extensions/BetaFeatures
PHPUnit 3.7.30 by Sebastian Bergmann.
Configuration read from tests/phpunit/suite.xml
Fatal error: Call to a member function isEnabled() on a non-object in /extensions/OATHAuth/OATHAuth.hooks.php on line 126
Call Stack:
- {main}() /core/tests/phpunit/phpunit.php:0
- MediaWikiPHPUnitCommand::main() /core/tests/phpunit/phpunit.php:160
- PHPUnit_TextUI_Command->run() /core/tests/phpunit/MediaWikiPHPUnitCommand.php:42
- PHPUnit_TextUI_TestRunner->doRun() /pear/PHPUnit/TextUI/Command.php:176
- PHPUnit_Framework_TestSuite->run() /pear/PHPUnit/TextUI/TestRunner.php:349
- PHPUnit_Framework_TestSuite->run() /pear/PHPUnit/Framework/TestSuite.php:705
- PHPUnit_Framework_TestSuite->run() /pear/PHPUnit/Framework/TestSuite.php:705
- PHPUnit_Framework_TestSuite->runTest() /pear/PHPUnit/Framework/TestSuite.php:745
- MediaWikiTestCase->run() /pear/PHPUnit/Framework/TestSuite.php:775
- PHPUnit_Framework_TestCase->run() /core/tests/phpunit/MediaWikiTestCase.php:133
- PHPUnit_Framework_TestResult->run() /pear/PHPUnit/Framework/TestCase.php:783
- PHPUnit_Framework_TestCase->runBare() /pear/PHPUnit/Framework/TestResult.php:648
- PHPUnit_Framework_TestCase->runTest() /pear/PHPUnit/Framework/TestCase.php:838
- ReflectionMethod->invokeArgs() /pear/PHPUnit/Framework/TestCase.php:983
- AutoEnrollmentTest->testAutoEnroll() /pear/PHPUnit/Framework/TestCase.php:983
- wfRunHooks() /extensions/BetaFeatures/tests/AutoEnrollmentTest.php:146
- Hooks::run() /core/includes/GlobalFunctions.php:4056
- call_user_func_array:{/core/includes/Hooks.php:206}() /core/includes/Hooks.php:206
- OATHAuthHooks::manageOATH() /core/includes/Hooks.php:206
OATHAuthHooks::manageOATH() calls OATHUser::newFromUser() which returns NULL when $user->getID() is 0.
Thus:
if ( $oathUser->isEnabled() )
produces a fatal.
I have made two tiny useless patches, but would appreciate someone that knows PHP to look at it :)
Version: unspecified
Severity: normal