File tree 2 files changed +7
-9
lines changed
2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace Spatie \Holidays \Countries ;
4
4
5
- use Carbon \CarbonImmutable ;
6
-
7
5
class Iran extends Country
8
6
{
9
7
public function countryCode (): string
10
8
{
11
9
return 'ir ' ;
12
10
}
13
-
11
+
14
12
protected function allHolidays (int $ year ): array
15
13
{
16
14
return [
@@ -26,4 +24,4 @@ protected function allHolidays(int $year): array
26
24
'قیام ۱۵ خرداد ' => '06-04 ' ,
27
25
];
28
26
}
29
- }
27
+ }
Original file line number Diff line number Diff line change 7
7
8
8
it ('can calculate iran holidays ' , function () {
9
9
CarbonImmutable::setTestNow ('2024-01-01 ' );
10
-
10
+
11
11
$ holidays = Holidays::for (country: 'ir ' )->get ();
12
-
12
+
13
13
expect ($ holidays )
14
14
->toBeArray ()
15
15
->not ()->toBeEmpty ();
16
-
16
+
17
17
expect (formatDates ($ holidays ))->toMatchSnapshot ();
18
18
});
19
19
20
20
it ('can calculate iran holidays in local ' , function (string $ locale , string $ newYearsDayName ) {
21
21
CarbonImmutable::setTestNow ('2024-01-01 ' );
22
22
$ result = Holidays::for (country: 'ir ' , year: null , locale: $ locale )->get ();
23
-
23
+
24
24
expect ($ result )->toBeArray ();
25
25
expect ($ result [7 ]['name ' ])->toBe ($ newYearsDayName );
26
26
})->with (
27
27
[
28
28
['en ' , 'Sizdah Bedar ' ],
29
29
['fa ' , 'سیزده بدر ' ],
30
30
]
31
- );
31
+ );
You can’t perform that action at this time.
0 commit comments