Feature: Add Test for is_blog_installed
#7880
Open
+107
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Trac Ticket: Core-54754
Summary
This PR adds a series of unit tests for the is_blog_installed() function in WordPress. The is_blog_installed() function checks if the WordPress installation is complete by verifying the existence of necessary options and tables in the database.
The tests ensure that the function behaves as expected under different conditions, including the presence or absence of the siteurl option, the state of the database tables, and certain WordPress constants like WP_REPAIRING.
Benefits
Coverage for Default Behavior: The tests ensure that is_blog_installed() behaves correctly in various scenarios, including default behavior, when siteurl is set or empty.
Edge Cases: The tests also account for edge cases such as the absence of siteurl, missing database tables, and when WordPress is in repair mode.
Performance Assurance: The caching test ensures that once the installation status is determined, it is cached for faster subsequent checks, improving performance.