Skip to content

JUnit File Parse Error #9674

@brandonja991

Description

@brandonja991

Bug Report

Subject Details
Rector version 2.3.8

Issue with JUnit output when diff includes ampersand due to ampersand not being escaped.

Minimal PHP Code Causing Issue

Any code that produces diff that results in ampersand being included in diff.

$foo = isset($bar) ? $bar : ($baz && $qux);
// TernaryToNullCoalesceingRector

Run Rector with output junit
Run xml validation tool
Xml validation tool should fail pointing to error parsing EntityName due to unescaped ampersand

Expected Behaviour

DOMDocument::createElement() is being used with a raw text value, but docs state only < and > are escaped when using that method. So rector needs to escape those characters prior to calling createElement() or use DOMDocument::createTextNode() to create the text node.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions