feat(rtt) : add SolidarityDayResolver (Pentecost Monday via computus)
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Tests\Service\Rtt;
|
||||
|
||||
use App\Service\Rtt\SolidarityDayResolver;
|
||||
use PHPUnit\Framework\Attributes\DataProvider;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class SolidarityDayResolverTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* Lundi de Pentecôte = dimanche de Pâques + 50 jours.
|
||||
* 2024 : Pâques 31/03 → 20/05 ; 2025 : Pâques 20/04 → 09/06 ; 2026 : Pâques 05/04 → 25/05.
|
||||
*/
|
||||
#[DataProvider('pentecostCases')]
|
||||
public function testPentecostMonday(int $year, string $expected): void
|
||||
{
|
||||
$resolver = new SolidarityDayResolver();
|
||||
|
||||
self::assertSame($expected, $resolver->pentecostMonday($year)->format('Y-m-d'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return iterable<string, array{int, string}>
|
||||
*/
|
||||
public static function pentecostCases(): iterable
|
||||
{
|
||||
yield '2024' => [2024, '2024-05-20'];
|
||||
|
||||
yield '2025' => [2025, '2025-06-09'];
|
||||
|
||||
yield '2026' => [2026, '2026-05-25'];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user