Page MenuHomePhabricator

[WikiLexicalData] Class "Structure" does not extend PHPUnit_Framework_TestCase.
Open, Needs TriagePublic

Description

Running the phpunit test suite from core as:

php test/phpunit/phpunit.php --testsuite extensions

Yields:

PHPUnit_Framework_Exception from line 144 of vendor/phpunit/phpunit/src/Framework/TestSuite.php:
Class "Structure" does not extend PHPUnit_Framework_TestCase.
Backtrace:
#0 vendor/phpunit/phpunit/src/Util/Configuration.php(898): PHPUnit_Framework_TestSuite->__construct(ReflectionClass)
#1 vendor/phpunit/phpunit/src/Util/Configuration.php(879): PHPUnit_Util_Configuration->getTestSuite(DOMElement, string)
#2 vendor/phpunit/phpunit/src/TextUI/Command.php(649): PHPUnit_Util_Configuration->getTestSuiteConfiguration(string)
#3 vendor/phpunit/phpunit/src/TextUI/Command.php(111): PHPUnit_TextUI_Command->handleArguments(array)
#4 vendor/phpunit/phpunit/src/TextUI/Command.php(100): PHPUnit_TextUI_Command->run(array, boolean)
#5 tests/phpunit/phpunit.php(134): PHPUnit_TextUI_Command::main()
#6 maintenance/doMaintenance.php(94): PHPUnitMaintClass->execute()
#7 tests/phpunit/phpunit.php(173): include(string)
#8 {main}

The reason is tests/phpunit/suite.xml defines a structure testsuite and PHPUnit attempts to load a class named structure, if such a class exists, it then asserts it is actuall a testcase class.

The problem is that WikiLexicalData defines a Structure class:

OmegaWiki/Attribute.php:60:class Structure {

And thus there is a clash. A good way to fix it would be to add namespace in WikiLexicalData.

Event Timeline

hashar created this task.Jun 25 2018, 12:16 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 25 2018, 12:16 PM
Vvjjkkii renamed this task from [WikiLexicalData] Class "Structure" does not extend PHPUnit_Framework_TestCase. to ucaaaaaaaa.Jul 1 2018, 1:02 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot renamed this task from ucaaaaaaaa to [WikiLexicalData] Class "Structure" does not extend PHPUnit_Framework_TestCase..Jul 2 2018, 10:15 AM
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.

Change 454296 had a related patch set uploaded (by Hashar; owner: Hashar):
[integration/config@master] WikiLexicalData is broken

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

Change 454296 merged by jenkins-bot:
[integration/config@master] WikiLexicalData is broken

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