Skip to content

tests: Remove unused media:thumbnail element in data#966

Merged
jtojnar merged 1 commit intomasterfrom
wip/jtojnar/test-data-missing-ns
Jan 18, 2026
Merged

tests: Remove unused media:thumbnail element in data#966
jtojnar merged 1 commit intomasterfrom
wip/jtojnar/test-data-missing-ns

Conversation

@jtojnar
Copy link
Member

@jtojnar jtojnar commented Jan 15, 2026

Currently, we only use these to test code paths that do not involve parsing
but it would be nice to be able to reuse the tests for other simple tests.

Unfortunately, Parser::parse will actually fail with error_string == "Unknown".

That is because xml_get_error_code() returns 201, which is not one of XML_ERROR_* codes:
https://www.php.net/manual/en/xml.error-codes.php

It looks like it is actually XML_NS_ERR_UNDEFINED_NAMESPACE leaking from libxml2.
I can confirm it with libxml_use_internal_errors(true); and dumping libxml_get_errors():

Namespace prefix media on thumbnail is not defined

Since we never use it anywhere, we can just drop the element.

Currently, we only use these to test code paths that do not involve parsing
but it would be nice to be able to reuse the tests for other simple tests.

Unfortunately, `Parser::parse` will actually fail with `error_string == "Unknown"`.

That is because `xml_get_error_code()` returns 201, which is not one of XML_ERROR_* codes:
https://www.php.net/manual/en/xml.error-codes.php

It looks like it is actually `XML_NS_ERR_UNDEFINED_NAMESPACE` leaking from libxml2.
I can confirm it with `libxml_use_internal_errors(true);` and dumping `libxml_get_errors()`:

    Namespace prefix media on thumbnail is not defined

Since we never use it anywhere, we can just drop the element.
@jtojnar jtojnar merged commit 659bfbd into master Jan 18, 2026
20 checks passed
@jtojnar jtojnar deleted the wip/jtojnar/test-data-missing-ns branch January 18, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants