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

Substitute cal_days_in_month #130

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

david-binda
Copy link
Contributor

This PR adds Metro_Sitemap_CLI::cal_days_in_month method, which either uses cal_days_in_month function if PHP Calendar extension is installed or calculates the max number of days in month using the date( 't' ) and mktime functions.

It also adds first unit tests for the Metro_Sitemap_CLI class, currently only covering the new cal_days_in_month. The WP_CLI and WP_CLI_Command classes are currently only mocked, as they are really not needed for existing tests.

This commit adds cal_days_in_month method to Metro_Sitemap_CLI class which either calls PHP Calendar's cal_days_in_month function, or does calculation using `date('t')` and `mktime`` functions.
Currently only covers the newly added cal_days_in_month method. This commit also includes a mocks for WP_CLI and WP_CLI_Command classes. We'll have to replace those once we increase the test coverage of the Metro_Sitemap_CLI class.
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.

1 participant