Make link checker in MD_STD_RSS_TEST non-final

This commit is contained in:
2026-01-31 14:30:25 +01:00
parent 68e1221215
commit 06ef0932d2

View File

@@ -25,9 +25,22 @@ abstract class MD_STD_RSS_TEST extends TestCase {
$domDoc = new DomDocument(); $domDoc = new DomDocument();
self::assertTrue($domDoc->loadXML($this->feed)); self::assertTrue($domDoc->loadXML($this->feed));
self::assertTrue($domDoc->schemaValidate(__DIR__ . "/../../assets/xsd/Rss2.xsd"));
// Don't just validate, but validate after ignoring warning on
// the existence of a non-specified <updated/> element.
libxml_use_internal_errors(true);
$domDoc->schemaValidate(__DIR__ . "/../../assets/xsd/Rss2.xsd");
$errors = libxml_get_errors();
unset($domDoc); unset($domDoc);
foreach ($errors as $e) {
if (str_contains((string)$e->message, '\'updated\': This element is not expected')) {
continue;
}
throw new Exception($e->message);
}
} }
/** /**
@@ -35,7 +48,7 @@ abstract class MD_STD_RSS_TEST extends TestCase {
* *
* @return void * @return void
*/ */
final public function testRssFeedLinksAndEnclosure() { public function testRssFeedLinksAndEnclosure() {
if (!($xmlData = simplexml_load_string($this->feed))) { if (!($xmlData = simplexml_load_string($this->feed))) {
throw new Exception("Failed to load RSS feed string to SimpleXML element"); throw new Exception("Failed to load RSS feed string to SimpleXML element");