The file
attribute of <testClass>
node of XML test list can be wrong
#6097
Labels
file
attribute of <testClass>
node of XML test list can be wrong
#6097
Summary
ListTestsAsXmlCommand
builds thefile
attribute of each<testClass>
node by getting the file path of the first test case method found in a class, and using the file path returned by calling$test->valueObjectForEvents()->file()
.This is not accurate as this returns the file path of the file where the method is defined, not the file path of the class. The method could be defined in a parent base class, or in a trait, and then the file returned would not be the one where the TestCase class is contained.
Current behavior
See above.
How to reproduce
Make an abstract base TestCase class with test case methods in it, a separate concrete class with no methods extending the abstract, and run phpunit with the
--list-tests-xml
option. The file attribute of the concrete<testClass>
will point to the abstract class file and not to the concrete one.Expected behavior
The file path should match the class, as the autoloader will map.
The text was updated successfully, but these errors were encountered: