This repository was archived by the owner on Jun 2, 2025. It is now read-only.
WordPress unit tests #26
Merged
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.
This PR brings the WordPress
tests/phpunit
test suite to the SQLite integration.Test commands
The PR adds the following commands:
composer run wp-setup
— Fetch the WordPress repository and set it up to run tests with SQLite.composer run wp-test-start
— Start and install the testing environment.composer run wp-test-phpunit
— Runtests/phpunit
with SQLite.composer run wp-test-clean
— Stop and remove the test containers.Additionally, it also exposes a generic
composer wp-run
command to run any of thewordpress-delop
commands.CI wrapper
Since at the moment, some WordPress tests fail and error with SQLite, I also implemented a simple wrapper under
.github/workflows/wp-tests-phpunit-run.js
, that lists the expected errors and failures and verifies agains them. The script will report all the possibly wrong combinations:This wrapper us useful for CI, so that we have a passing CI job even though some tests fail, and we can explicitly state which ones those are.
Fixes
The test failures and errors revealed some issues in the SQLite driver, and I'm adding a few of the small and quick fixes in this PR. The more complex ones, such as correct temporary table handling and #17, will be handled in separate tickets.