Add AVefi as norm data repository for tags
More information: https://www.av-efi.net/
This commit is contained in:
@@ -48,6 +48,34 @@ final class MDNodaRepositoryTest extends TestCase {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider for validating AVefi IDs.
|
||||
*
|
||||
* @return Generator<string, array{0: string|false, 1: string}>
|
||||
*/
|
||||
public static function avefiIdForValidationProvider():Generator {
|
||||
|
||||
yield "Full URL, https" => ["21.11155/D80067AB-B4F5-4139-8D78-540D8BC001B8", "https://www.av-efi.net/res/21.11155/D80067AB-B4F5-4139-8D78-540D8BC001B8"];
|
||||
yield "ID" => ["21.11155/D80067AB-B4F5-4139-8D78-540D8BC001B8", "21.11155/D80067AB-B4F5-4139-8D78-540D8BC001B8"];
|
||||
yield "Broken input / XX503494safdsaf;3" => [false, "XX503494safdsaf;3"];
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure validating references to the AVefi works.
|
||||
*
|
||||
* @param string|false $expected Expected output.
|
||||
* @param string $inputString Input string.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
#[DataProvider('avefiIdForValidationProvider')]
|
||||
public function testAvefiIdValidation(string|false $expected, string $inputString):void {
|
||||
|
||||
self::assertEquals($expected, MDNodaRepository::avefi->validateId($inputString));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider for validating BNE IDs.
|
||||
*
|
||||
@@ -62,17 +90,6 @@ final class MDNodaRepositoryTest extends TestCase {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider for validating BNE IDs.
|
||||
*
|
||||
* @return Generator<string, array{0: string|false, 1: string}>
|
||||
*/
|
||||
public static function bnfIdForValidationProvider():Generator {
|
||||
|
||||
yield "Broken input / duplicate https" => [false, "https://catalogue.bnf.fr/ark:/12148/cbhttps://catalogue.bnf.fr/ark:/12148/cbhttps://catalogue.bnf.fr/ark:/12148/cb104183522"];
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensure validating references to the BNE works.
|
||||
*
|
||||
@@ -88,6 +105,17 @@ final class MDNodaRepositoryTest extends TestCase {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider for validating BNE IDs.
|
||||
*
|
||||
* @return Generator<string, array{0: string|false, 1: string}>
|
||||
*/
|
||||
public static function bnfIdForValidationProvider():Generator {
|
||||
|
||||
yield "Broken input / duplicate https" => [false, "https://catalogue.bnf.fr/ark:/12148/cbhttps://catalogue.bnf.fr/ark:/12148/cbhttps://catalogue.bnf.fr/ark:/12148/cb104183522"];
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider for validating GND IDs.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user