Testing
Yasumi includes a PHPUnit test suite that contains more than 4.7K unit tests with multiple iterations of assertions. Since Yasumi is using randomized years for asserting the holidays, multiple iterations of assertions get executed to ensure the holidays will be calculated for many years.
The tests are grouped in some test suites to make testing a bit easier:
- "Base"
- For testing the base functionality of Yasumi
- "Argentina"
- For separately testing the Argentina Holiday Provider
- "Australia"
- For separately testing the Australia Holiday Provider
- "Austria"
- For separately testing the Austria Holiday Provider
- "Belgium"
- For separately testing the Belgium Holiday Provider
- "Bosnia"
- For separately testing the Bosnia & Herzegovina Holiday Provider
- "Brazil"
- For separately testing the Brazil Holiday Provider
- "Canada"
- For separately testing the Canada Holiday Provider
- "Croatia"
- For separately testing the Croatia Holiday Provider
- "CzechRepublic"
- For separately testing the Czech Republic Holiday Provider
- "Denmark"
- For separately testing the Denmark Holiday Provider
- "Estonia"
- For separately testing the Estonia Holiday Provider
- "Finland"
- For separately testing the Finland Holiday Provider
- "France"
- For separately testing the France Holiday Provider
- "Georgia"
- For separately testing the Georgia Holiday Provider
- "Germany"
- For separately testing the Germany Holiday Provider
- "Greece"
- For separately testing the Greece Holiday Provider
- "Hungary"
- For separately testing the Hungary Holiday Provider
- "Ireland"
- For separately testing the Ireland Holiday Provider
- "Italy"
- For separately testing the Italy Holiday Provider
- "Japan"
- For separately testing the Japan Holiday Provider
- "Latvia"
- For separately testing the Latvia Holiday Provider
- "Lithuania"
- For separately testing the Lithuania Holiday Provider
- "Luxembourg"
- For separately testing the Luxembourg Holiday Provider
- "Mexico"
- For separately testing the Mexico Holiday Provider
- "Netherlands"
- For separately testing the Netherlands Holiday Provider
- "NewZealand"
- For separately testing the New Zealand Holiday Provider
- "Norway"
- For separately testing the Norway Holiday Provider
- "Poland"
- For separately testing the Poland Holiday Provider
- "Portugal"
- For separately testing the Portugal Holiday Provider
- "Romania"
- For separately testing the Romania Holiday Provider
- "Russia"
- For separately testing the Russia Holiday Provider
- "Slovakia"
- For separately testing the Slovakia Holiday Provider
- "SouthAfrica"
- For separately testing the South Africa Holiday Provider
- "SouthKorea"
- For separately testing the South Korea Holiday Provider
- "Spain"
- For separately testing the Spain Holiday Provider
- "Sweden"
- For separately testing the Sweden Holiday Provider
- "Switzerland"
- For separately testing the Switzerland Holiday Provider
- "Turkey"
- For separately testing the Turkey Holiday Provider
- "USA"
- For separately testing the United States Holiday Provider
- "Ukraine"
- For separately testing the Ukraine Holiday Provider
- "UnitedKingdom"
- For separately testing the United Kingdom Holiday Provider
You will need a working installation of Composer before continuing.
First, install the dependencies:
composer install
Then run phpunit:
composer test
alternatively run with:
vendor/bin/phpunit
If the test suite passes on your local machine you should be good to go.
When you make a pull request, the tests will automatically be run again by GitHub Actions on multiple php versions. In addition, your pull requests are checked automatically for the proper PSR-12 coding style, with a static analysis performed.
Last updated 01/07/2024