feat: permettre la correction des soins antiparasitaires

This commit is contained in:
Alexandre NOEL 2026-09-15 22:15:59 +02:00
commit f20d7cc965
14 changed files with 233 additions and 33 deletions

View file

@ -153,6 +153,10 @@ try {
'Les cinq box initiaux ne sont pas disponibles',
);
});
$test('Une nouvelle fiche de chat propose la race Chat Européen', function () use ($assert): void {
$controller = (string) file_get_contents(dirname(__DIR__) . '/app/Controllers/AnimalRecordActions.php');
$assert(str_contains($controller, "'breed' => 'Chat Européen'"));
});
$test('Les tournées acceptent quatre créneaux configurables', function () use ($db, $assert): void {
foreach (ShelterRoomService::PERIODS as $period) {
$db->prepare('INSERT INTO care_rounds(round_date,period) VALUES(?,?)')->execute(['2099-01-01', $period]);
@ -198,6 +202,19 @@ try {
$assert(!str_contains($modal, 'name="administered_by_name"'));
$assert(str_contains($summary, "\$v['clinic_name']"));
});
$test('Vaccins et vermifuges peuvent être corrigés sans nouveau déstockage', function () use ($assert): void {
$modals = (string) file_get_contents(dirname(__DIR__) . '/app/Views/_animal_show_modals.php');
$medical = (string) file_get_contents(dirname(__DIR__) . '/app/Views/_animal_show_medical.php');
$vaccines = (string) file_get_contents(dirname(__DIR__) . '/app/Controllers/AnimalMedicalActions.php');
$dewormings = (string) file_get_contents(dirname(__DIR__) . '/app/Controllers/DewormingController.php');
$assert(substr_count($modals, 'name="entry_id"') >= 2);
$assert(str_contains($medical, 'edit-vaccine'));
$assert(str_contains($medical, 'edit-deworming'));
$assert(str_contains($vaccines, 'if ($entryId > 0)'));
$assert(str_contains($dewormings, 'if ($entryId > 0)'));
$assert(strpos($vaccines, 'if ($entryId > 0)') < strpos($vaccines, 'InventoryService::consumeBatch'));
$assert(strpos($dewormings, 'if ($entryId > 0)') < strpos($dewormings, 'InventoryService::consumeBatch'));
});
$test('Les paramètres sont enregistrés et relus', function () use ($assert): void {
AppSettings::save(['association_name' => 'Refuge Test', 'app_language' => 'en'], null);
$assert(AppSettings::get('association_name') === 'Refuge Test');