1
0
Fork 0
mirror of https://github.com/dorny/test-reporter.git synced 2026-03-21 23:52:12 +01:00
test-reporter/__tests__/__outputs__/phpunit-phpcheckstyle-results.md
YuF-9468 f0016cb1da fix: Extract error message from PHPUnit error details when message attribute is missing
Fixes #711

When PHPUnit XML output contains <error> or <failure> elements without a
message attribute, the parser now extracts the error message from the error
details text instead of only showing the error type.

The improved logic:
1. Prefer message attribute when present (with type prepended)
2. Extract error message from details when it contains a line matching
   the error type (e.g., "TypeError: ...")
3. Fall back to first line of details
4. Finally, use error type as last resort

This provides more informative error messages in test reports when
PHPUnit outputs errors with the full stack trace in the element text
rather than a message attribute.
2026-03-16 21:39:44 +08:00

2.8 KiB

Tests failed

Report Passed Failed Skipped Time
fixtures/external/phpunit/phpcheckstyle-phpunit.xml 28 2 41ms

 fixtures/external/phpunit/phpcheckstyle-phpunit.xml

30 tests were completed in 41ms with 28 passed, 2 failed and 0 skipped.

Test suite Passed Failed Skipped Time
CommentsTest 3 7ms
DeprecationTest 1 1ms
GoodTest 4 5ms
IndentationTest 8 8ms
MetricsTest 1 4ms
NamingTest 2 3ms
OptimizationTest 1 1ms
OtherTest 2 2 7ms
PHPTagsTest 2 1ms
ProhibitedTest 1 1ms
StrictCompareTest 1 2ms
UnusedTest 2 2ms

 CommentsTest

✅ testGoodDoc
✅ testComments
✅ testTODOs

 DeprecationTest

✅ testDeprecations

 GoodTest

✅ testGood
✅ testDoWhile
✅ testAnonymousFunction
✅ testException

 IndentationTest

✅ testTabIndentation
✅ testSpaceIndentation
✅ testSpaceIndentationArray
✅ testGoodSpaceIndentationArray
✅ testGoodIndentationNewLine
✅ testGoodIndentationSpaces
✅ testBadSpaces
✅ testBadSpaceAfterControl

 MetricsTest

✅ testMetrics

 NamingTest

✅ testNaming
✅ testFunctionNaming

 OptimizationTest

✅ testTextAfterClosingTag

 OtherTest

❌ testOther
	OtherTest::testOther
❌ testException
	OtherTest::testException
✅ testEmpty
✅ testSwitchCaseNeedBreak

 PHPTagsTest

✅ testTextAfterClosingTag
✅ testClosingTagNotNeeded

 ProhibitedTest

✅ testProhibited

 StrictCompareTest

✅ testStrictCompare

 UnusedTest

✅ testGoodUnused
✅ testBadUnused