From 1fa7a39e20b2938ddd46b70f07b9eaf123a24740 Mon Sep 17 00:00:00 2001 From: Niels Vanpachtenbeke <10651054+Nielsvanpach@users.noreply.github.com> Date: Thu, 25 Jan 2024 11:50:10 +0100 Subject: [PATCH] use our invade package instead of Reflection --- composer.json | 1 + tests/CountryTest.php | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 9f8a2f7fb..8e0f585dc 100644 --- a/composer.json +++ b/composer.json @@ -29,6 +29,7 @@ "laravel/prompts": "^0.1.15", "pestphp/pest": "^2.31", "phpstan/phpstan": "^1.10.56", + "spatie/invade": "^2.0", "spatie/ray": "^1.40.1", "symfony/var-dumper": "^6.4" }, diff --git a/tests/CountryTest.php b/tests/CountryTest.php index 513b7c419..6699ab606 100644 --- a/tests/CountryTest.php +++ b/tests/CountryTest.php @@ -2,16 +2,12 @@ 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); + $easter = invade($country)->orthodoxEaster($year); expect($easter->format('Y-m-d'))->toBe($date); })->with([