Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add New Zealand Holidays #207

Merged
merged 2 commits into from
Jun 15, 2024
Merged

Add New Zealand Holidays #207

merged 2 commits into from
Jun 15, 2024

Conversation

jpgnz
Copy link
Contributor

@jpgnz jpgnz commented Feb 18, 2024

Adding New Zealand holidays. Took guidance from Australia and Wales.

Tests based on Welsh Tests given same Mondayisation
Copy link
Member

@Nielsvanpach Nielsvanpach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

$holidays = Holidays::for(country: 'nz')->get();

expect($holidays)->toBeArray()->not()->toBeEmpty();
expect(formatDates($holidays))->toMatchSnapshot();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of a complete snapshot test, it might be more interesting to only test the specific case (it has a substitute day for new year)

$holidays = Holidays::for(country: 'nz')->get();

expect($holidays)->toBeArray()->not()->toBeEmpty();
expect(formatDates($holidays))->toMatchSnapshot();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of a complete snapshot test, it might be more interesting to only test the specific case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took guidance from WalesTest.php as I wasn't quite sure what coverage would be appropriate.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That test had been better with specific assertions too

@Nielsvanpach Nielsvanpach merged commit db0f38a into spatie:main Jun 15, 2024
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants