diff --git a/src/enums/MDNodaRepository.php b/src/enums/MDNodaRepository.php index af36a85..1199cb4 100644 --- a/src/enums/MDNodaRepository.php +++ b/src/enums/MDNodaRepository.php @@ -843,6 +843,8 @@ public function validateId(string $id):string|false { 'http://vocab.getty.edu/ulan/', 'http://vocab.getty.edu/page/ulan/', 'https://vocab.getty.edu/page/ulan/', + 'https://vocab.getty.edu/page/ulan/', + 'https://vocab.getty.edu/ulan/', 'http://www.getty.edu/vow/ULANFullDisplay?find=&role=&nation=&subjectid=', 'https://www.getty.edu/vow/ULANFullDisplay?find=&role=&nation=&subjectid=', ]), diff --git a/tests/MDNodaRepositoryTest.php b/tests/MDNodaRepositoryTest.php index e35a6f6..b9d517e 100644 --- a/tests/MDNodaRepositoryTest.php +++ b/tests/MDNodaRepositoryTest.php @@ -201,6 +201,17 @@ public static function npgIdForValidationProvider():Generator { } + /** + * Data provider for validating NPG IDs (National Portrait Gallery). + * + * @return Generator + */ + public static function ulanIdForValidationProvider():Generator { + + yield "Full URL, https / https://vocab.getty.edu/ulan/500054662" => ["500054662", "https://vocab.getty.edu/ulan/500054662"]; + + } + /** * Ensure validating NPG entries works (National Portrait Gallery). * @@ -216,6 +227,21 @@ public function testNpgIdValidation(string|false $expected, string $inputString) } + /** + * Ensure validating ULAN entries works. + * + * @param string|false $expected Expected output. + * @param string $inputString Input string. + * + * @return void + */ + #[DataProvider('ulanIdForValidationProvider')] + public function testUlanIdValidation(string|false $expected, string $inputString):void { + + self::assertEquals($expected, MDNodaRepository::ulan->validateId($inputString)); + + } + /** * Data provider for validating references to the Library of Congress works. *