Page MenuHomePhabricator

Running PHPUnit on includes/ or includes/parser/ results in "Call to a member function staticSetup() on null"
Closed, ResolvedPublic

Description

ParserIntegrationTest has a constructor with mandatory parameters. PHPUnit wants to run it, but constructs it with no parameters, which results in a long list of notices and two failed tests. tests/phpunit/suite.xml seems to try to tell PHPUnit not to run it, but when I do

php tests/phpunit/phpunit.php tests/phpunit/includes/parser/

or

php tests/phpunit/phpunit.php tests/phpunit/includes/

it gets run anyway.

Is there some fix we could make to the suite.xml file? Or maybe rename it to not end in "Test" so PHPUnit ignores it by itself?

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 5 2018, 6:34 PM

Change 451641 had a related patch set uploaded (by simetrical; owner: simetrical):
[mediawiki/core@master] Only use "*Test.php" for actual PHPUnit tests

https://gerrit.wikimedia.org/r/451641

Change 451641 merged by jenkins-bot:
[mediawiki/core@master] Only use "*Test.php" for actual PHPUnit tests

https://gerrit.wikimedia.org/r/451641

Krinkle moved this task from PHPUnit to QUnit on the MediaWiki-Core-Testing board.
Krinkle moved this task from QUnit to PHPUnit on the MediaWiki-Core-Testing board.
Simetrical closed this task as Resolved.Aug 12 2019, 9:18 AM
Simetrical claimed this task.

Seems fixed.