Skip to content

Commit a4a9318

Browse files
committed
try allow tests against v4 schemas
1 parent 14c34e1 commit a4a9318

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Health.php

+9-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,15 @@ private static function retrieveSchemaForCategory(string $category, ?string $dat
280280
{
281281
switch ($category) {
282282
case 'universalcalendar':
283-
return Health::DATA_PATH_TO_SCHEMA[ $dataPath ];
283+
if (array_key_exists($dataPath, Health::DATA_PATH_TO_SCHEMA)) {
284+
return Health::DATA_PATH_TO_SCHEMA[ $dataPath ];
285+
}
286+
$versionedDataPath = preg_replace("/\/api\/v[4-9]\//", "/api/dev/", $dataPath);
287+
if (array_key_exists($versionedDataPath, Health::DATA_PATH_TO_SCHEMA)) {
288+
$tempSchemaPath = Health::DATA_PATH_TO_SCHEMA[ $versionedDataPath ];
289+
return preg_replace("/\/api\/v[4-9]\//", "/api/dev/", $tempSchemaPath);
290+
}
291+
return null;
284292
case 'nationalcalendar':
285293
return LitSchema::NATIONAL;
286294
case 'diocesancalendar':

0 commit comments

Comments
 (0)