https://bugzilla.wikimedia.org/show_bug.cgi?id=67138

            Bug ID: 67138
           Summary: AutoEnrollmentTest produce a fatal error with OATHAuth
                    extension
           Product: MediaWiki extensions
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: BetaFeatures
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]
       Web browser: ---
   Mobile Platform: ---

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:
  1. {main}() /core/tests/phpunit/phpunit.php:0
  2. MediaWikiPHPUnitCommand::main() /core/tests/phpunit/phpunit.php:160
  3. PHPUnit_TextUI_Command->run()
/core/tests/phpunit/MediaWikiPHPUnitCommand.php:42
  4. PHPUnit_TextUI_TestRunner->doRun() /pear/PHPUnit/TextUI/Command.php:176
  5. PHPUnit_Framework_TestSuite->run() /pear/PHPUnit/TextUI/TestRunner.php:349
  6. PHPUnit_Framework_TestSuite->run()
/pear/PHPUnit/Framework/TestSuite.php:705
  7. PHPUnit_Framework_TestSuite->run()
/pear/PHPUnit/Framework/TestSuite.php:705
  8. PHPUnit_Framework_TestSuite->runTest()
/pear/PHPUnit/Framework/TestSuite.php:745
  9. MediaWikiTestCase->run() /pear/PHPUnit/Framework/TestSuite.php:775
  10. PHPUnit_Framework_TestCase->run()
/core/tests/phpunit/MediaWikiTestCase.php:133
  11. PHPUnit_Framework_TestResult->run()
/pear/PHPUnit/Framework/TestCase.php:783
  12. PHPUnit_Framework_TestCase->runBare()
/pear/PHPUnit/Framework/TestResult.php:648
  13. PHPUnit_Framework_TestCase->runTest()
/pear/PHPUnit/Framework/TestCase.php:838
  14. ReflectionMethod->invokeArgs() /pear/PHPUnit/Framework/TestCase.php:983
  15. AutoEnrollmentTest->testAutoEnroll()
/pear/PHPUnit/Framework/TestCase.php:983
  16. wfRunHooks() /extensions/BetaFeatures/tests/AutoEnrollmentTest.php:146
  17. Hooks::run() /core/includes/GlobalFunctions.php:4056
  18. call_user_func_array:{/core/includes/Hooks.php:206}()
/core/includes/Hooks.php:206
  19. 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 :)

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to