parent
e7176b6371
commit
1378aefa9c
14 changed files with 93 additions and 35 deletions
|
|
@ -27,6 +27,7 @@ foreach (
|
|||
'NotificationService',
|
||||
'PrivacyService',
|
||||
'StatisticsService',
|
||||
'PricingService',
|
||||
'SpeciesService',
|
||||
'LabReferenceService',
|
||||
'PublicContentFormatter',
|
||||
|
|
@ -133,6 +134,15 @@ try {
|
|||
$assert(AppSettings::get('app_language') === 'en');
|
||||
I18n::setLocale('fr');
|
||||
});
|
||||
$test('Les frais d’adoption sont configurables par espèce', function () use ($db, $assert): void {
|
||||
$fees = PricingService::adoptionFees();
|
||||
$assert(isset($fees['chat']), 'Tarif du chat absent');
|
||||
$db->exec("UPDATE adoption_fee_rules SET fee_before_sterilization=175,fee_after_sterilization=225,is_free=0 WHERE species_code='chat'");
|
||||
$assert(PricingService::adoptionFee('chat', false) === 175);
|
||||
$assert(PricingService::adoptionFee('chat', true) === 225);
|
||||
$db->exec("UPDATE adoption_fee_rules SET is_free=1 WHERE species_code='chat'");
|
||||
$assert(PricingService::adoptionFee('chat', true) === null, 'Le tarif libre n’est pas appliqué');
|
||||
});
|
||||
$test('Les identifiants RNA et SIRET sont contrôlés', function () use ($assert): void {
|
||||
$assert(Ids::validRna('W123456789'));
|
||||
$assert(!Ids::validRna('W1234'));
|
||||
|
|
|
|||
Loading…
Reference in a new issue