Add tests to ensure invalid IDs are not validated

This commit is contained in:
2023-10-18 22:42:49 +02:00
parent 8f32c30fbd
commit f14d7edc6e
2 changed files with 18 additions and 8 deletions

View File

@ -375,7 +375,6 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
return false;
}
if (self::_is_numeric(strtr($id, ['-' => '', 'X' => ''])) === false) {
throw new Exception($id);
return false;
}
@ -611,9 +610,9 @@ enum MDNodaRepository implements MDValueEnumInterface, JsonSerializable {
'https://vocab.getty.edu/page/aat/',
]),
self::ackerbau => self::validateNumericId($id, ['https://term.museum-digital.de/ackerbau/tag/']),
self::bne => self::validateBneId($id, ['http://datos.bne.es/persona/']),
self::bne => self::validateBneId($id, ['http://datos.bne.es/persona/', 'https://datos.bne.es/persona/']),
self::bnf => self::validateBnfId($id),
self::cona => self::validateNumericId($id, ['https://vocab.getty.edu/page/cona/']),
self::cona => self::validateNumericId($id, ['http://vocab.getty.edu/page/cona/', 'https://vocab.getty.edu/page/cona/']),
self::editionhumboldtdigital => self::validateGndId($id, ['https://edition-humboldt.de/register/personen/detail.xql?normid=http://d-nb.info/gnd/']),
self::gnd => self::validateGndId($id, ['http://d-nb.info/gnd/', 'https://d-nb.info/gnd/']),
self::grobsystematik => self::validateNumericId($id, ['https://term.museum-digital.de/grobsystematik/tag/']),