Page MenuHomePhabricator

BetaFeatures: Unit tests trigger notices in MobileFrontend
Closed, ResolvedPublic

Description

I have tried running phpunit unit tests with master versions of mw BetaFeatures and MobileFrontend and got a bunch of PHP notices.

Step to reproduce:

$ /bin/ls -1 extensions/
BetaFeatures
MobileFrontend
README

$ php tests/phpunit/phpunit.php extensions/BetaFeatures

Will attach traces


Version: unspecified
Severity: minor

Details

Reference
bz67139

Event Timeline

bzimport raised the priority of this task from to High.
bzimport set Reference to bz67139.
bzimport added a subscriber: Unknown Object (MLST).
hashar created this task.Jun 26 2014, 4:06 PM

Created attachment 15750
Notice: Undefined index: skin in /extensions/MobileFrontend/includes/MobileFrontend.hooks.php on line 633

Attached:

Created attachment 15751
Warning: array_search() expects parameter 2 to be array, null given in /extensions/MobileFrontend/includes/MobileFrontend.hooks.php on line 633

Attached:

We really need tests to pass when all wmf extensions are installed together. That is preventing us from progression toward the HHVM migrating. Raising priority to High.

This is another false positive issue, because MobileFrontend and BetaFeatures can't run at the same time (Mobile doesn't use it), but let's get this fixed all the same.

hashar added a comment.Jul 2 2014, 8:53 AM

Indeed Bartosz, good catch!

Fixed up by https://gerrit.wikimedia.org/r/#/c/143042/

amusso@aeriale:/srv/trunk(masteru=)$ /bin/ls extensions/
APC BetaFeatures MobileFrontend README link_ext.sh wmfexts
amusso@aeriale:/srv/trunk(masteru=)$ cd tests/phpunit/
/srv/trunk/tests/phpunit
amusso@aeriale:/srv/trunk/tests/phpunit(masteru=)$ php phpunit.php --testsuite extensions
PHPUnit 3.7.30 by Sebastian Bergmann.

Configuration read from /Users/amusso/projects/mediawiki/core/tests/phpunit/suite.xml

............................................................... 63 / 340 ( 18%)
............................................................... 126 / 340 ( 37%)
............................................................... 189 / 340 ( 55%)
............................................................... 252 / 340 ( 74%)
............................................................... 315 / 340 ( 92%)
.........................

Time: 6.61 seconds, Memory: 44.75Mb

OK (340 tests, 408 assertions)
amusso@aeriale:/srv/trunk/tests/phpunit(masteru=)$