setAccessible(true); $d = fn(string $raw): string => $parse->invoke($importer, $raw); check('date complète', $d('2022-06-15'), '2022-06-15'); check('datetime ISO', $d('2022-06-15T10:30:00Z'), '2022-06-15'); check('année-mois', $d('2022-06'), '2022-06-01'); check('année seule', $d('2022'), '2022-01-01'); // strtotime("2022") = heure, pas année check('chaîne vide', $d(''), ''); check('espaces', $d(' 2021 '), '2021-01-01'); check('invalide', $d('not-a-date'), ''); echo "== get_category_id (résolution par slug) ==\n"; check('ART → articles (16)', $importer->get_category_id('ART'), 16); check('OUV → ouvrages (15)', $importer->get_category_id('OUV'), 15); check('THESE → soutenances (14)', $importer->get_category_id('THESE'), 14); check('SON → medias (19)', $importer->get_category_id('SON'), 19); check('REPORT → publications (4)',$importer->get_category_id('REPORT'), 4); check('type inconnu → null', $importer->get_category_id('XYZ'), null); echo "== Thalim_HAL_Pods_Storage (résolution par nom) ==\n"; check('pod post = 8', Thalim_HAL_Pods_Storage::pod_id(), 8); check('champ categorie = 16', Thalim_HAL_Pods_Storage::field_id('categorie'), 16); check('champ membres = 178', Thalim_HAL_Pods_Storage::field_id('membres'), 178); check('champ etiquettes = 652',Thalim_HAL_Pods_Storage::field_id('etiquettes'), 652); check('champ axes = 270', Thalim_HAL_Pods_Storage::field_id('axes_thematiques'), 270); check('champ inconnu = 0', Thalim_HAL_Pods_Storage::field_id('champ_bidon'), 0); echo "\n$count tests, $failures échec(s)\n"; exit($failures ? 1 : 0);