Skip to content

Commit

Permalink
add a test case to make sure orthodox easter is calculated correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Nielsvanpach committed Jan 25, 2024
1 parent eb9833e commit 03fe5c2
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions tests/CountryTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

namespace Spatie\Holidays\Tests;

use ReflectionMethod;
use Spatie\Holidays\Countries\Belgium;

it('can calculate orthodox easter', function (int $year, string $date) {
$country = Belgium::make();

$reflectionMethod = new ReflectionMethod('Spatie\Holidays\Countries\Belgium', 'orthodoxEaster');
$reflectionMethod->setAccessible(true);

$easter = $reflectionMethod->invoke($country, $year);

expect($easter->format('Y-m-d'))->toBe($date);
})->with([
[1997, "1997-04-27"],
[1998, "1998-04-19"],
[1999, "1999-04-11"],
[2000, "2000-04-30"],
[2001, "2001-04-15"],
[2002, "2002-05-05"],
[2003, "2003-04-27"],
[2004, "2004-04-11"],
[2005, "2005-05-01"],
[2006, "2006-04-23"],
[2007, "2007-04-08"],
[2008, "2008-04-27"],
[2009, "2009-04-19"],
[2010, "2010-04-04"],
[2011, "2011-04-24"],
[2012, "2012-04-15"],
[2013, "2013-05-05"],
[2014, "2014-04-20"],
[2015, "2015-04-12"],
[2016, "2016-05-01"],
[2017, "2017-04-16"],
[2018, "2018-04-08"],
[2019, "2019-04-28"],
[2020, "2020-04-19"],
[2021, "2021-05-02"],
[2022, "2022-04-24"],
[2023, "2023-04-16"],
[2024, "2024-05-05"],
[2025, "2025-04-20"],
[2026, "2026-04-12"],
[2027, "2027-05-02"],
[2028, "2028-04-16"],
[2029, "2029-04-08"],
]);

0 comments on commit 03fe5c2

Please sign in to comment.