Open b1rdex opened 5 years ago
Correct me if I am wrong, but canonicalization, and therefore the call to DOMNode::C14N()
, is optional. If it is "bad" for you then do not enable it.
I can't say it's bad, it just does strange thing that leads to not readable output. How am I supposed to read this comparison diff?
PHPUnit 8.1.3 by Sebastian Bergmann and contributors.
..............................F
Time: 8.54 seconds, Memory: 42.00 MB
There was 1 failure:
1) ApiDistributorsAuthTest::testAuthOfNotDistributor
Failed asserting that two DOM documents are equal.
--- Expected
+++ Actual
@@ @@
<distributors xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<auth>
<result>error</result>
- <message>Пользователь не является пунктом выдачи</message>
+ <message>Неверный логин или пароль</message>
</auth>
</distributors>
AFAIK canonical XML is always UTF-8 so my simple fix in example should be OK for any XML.
Can you please send a pull request with your fix? Thanks!
DOMNode::C14N() call removes encoding from XML somehow. This is bad for comparison of non ascii xmls, because it makes them unreadable. Please see example: https://3v4l.org/FvCAs