Page MenuHomePhabricator

phpunit failure: ApiOptionsTest::testReset User::saveSettings() was not expected to be called more than once
Open, LowestPublic

Description

From where could this come from (see http://paste.debian.net/111811/ for the enabled extensions)?

  1. ApiOptionsTest::testReset

User::saveSettings() was not expected to be called more than once.

/srv/vagrant/mediawiki/includes/api/ApiOptions.php:119
/srv/vagrant/mediawiki/tests/phpunit/includes/api/ApiOptionsTest.php:151
/srv/vagrant/mediawiki/tests/phpunit/includes/api/ApiOptionsTest.php:233
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:133
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42
/srv/vagrant/mediawiki/tests/phpunit/phpunit.php:160


Version: master
Severity: normal

Details

Reference
bz68654

Event Timeline

bzimport raised the priority of this task from to Lowest.
bzimport set Reference to bz68654.
bzimport added a subscriber: Unknown Object (MLST).

Presumably some extension hooking 'UserResetAllOptions' and calling saveSettings.

(In reply to Brad Jorsch from comment #1)

Presumably some extension hooking 'UserResetAllOptions' and calling
saveSettings.

nemobis@tools-login:/shared/mediawiki$ ack-grep UserResetAllOptions extensions/

No results. Many for:

nemobis@tools-login:/shared/mediawiki$ ack-grep --php "saveSettings\("

Created attachment 16050
nemobis@tools-login:/shared/mediawiki$ ack-grep --php "saveSettings\("

Attached:

Maybe BetaFeatures? Doing what in attachment 16052 [details] minus Wikibase:

vagrant@nemobis:/vagrant/mediawiki/tests/phpunit$ php5 phpunit.php includes
PHPUnit 3.7.37 by Sebastian Bergmann.

[...]

  1. ApiOptionsTest::testSpecialOption

User::saveSettings() was not expected to be called.

/srv/vagrant/mediawiki/extensions/BetaFeatures/BetaFeaturesHooks.php:308
/srv/vagrant/mediawiki/includes/Hooks.php:206
/srv/vagrant/mediawiki/includes/GlobalFunctions.php:4031
/srv/vagrant/mediawiki/includes/Preferences.php:99
/srv/vagrant/mediawiki/includes/api/ApiOptions.php:75
/srv/vagrant/mediawiki/tests/phpunit/includes/api/ApiOptionsTest.php:151
/srv/vagrant/mediawiki/tests/phpunit/includes/api/ApiOptionsTest.php:405
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:133
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42

  1. ApiOptionsTest::testUnknownOption

User::saveSettings() was not expected to be called.

/srv/vagrant/mediawiki/extensions/BetaFeatures/BetaFeaturesHooks.php:308
/srv/vagrant/mediawiki/includes/Hooks.php:206
/srv/vagrant/mediawiki/includes/GlobalFunctions.php:4031
/srv/vagrant/mediawiki/includes/Preferences.php:99
/srv/vagrant/mediawiki/includes/api/ApiOptions.php:75
/srv/vagrant/mediawiki/tests/phpunit/includes/api/ApiOptionsTest.php:151
/srv/vagrant/mediawiki/tests/phpunit/includes/api/ApiOptionsTest.php:428
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiTestCase.php:133
/srv/vagrant/mediawiki/tests/phpunit/MediaWikiPHPUnitCommand.php:42

That'd probably do it: that's hooking GetPreferences and triggering an extra pref save.