-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add WP PHPUnit integration tests (#269)
* Downgrade PHPUnit to 9 * Add render integration test * Fix indentation changes in BlockBindingsTest * Use field IDs and helper methods to check render result * Fix typo * Fix bootstrap file phpcs error * Add GitHub workflow for integration tests * Re-add PHP stubs * Fix register_block_configuration() to persist block configurations * Add WP_PHPUnit stubs for psalm * Minor variable rename * Fix missing `run` step in integration test YML * Fix function name in integration tests --------- Co-authored-by: Max Schmeling <[email protected]>
- Loading branch information
1 parent
a571052
commit 96eee5f
Showing
13 changed files
with
864 additions
and
339 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Integration Tests | ||
|
||
on: | ||
# Run on all pull requests. | ||
pull_request: | ||
push: | ||
branches: | ||
- trunk | ||
|
||
# Cancels all previous workflow runs for pull requests that have not completed. | ||
concurrency: | ||
# The concurrency group contains the workflow name and the branch name for pull requests | ||
# or the commit hash for any other events. | ||
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
name: WordPress Integration Tests | ||
runs-on: ubuntu-24.04 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Use desired version of NodeJS | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 20 | ||
cache: npm | ||
|
||
- name: Npm install | ||
run: npm ci | ||
|
||
- name: Start up WordPress environment | ||
run: npm run dev:build | ||
|
||
- name: Run Integration tests | ||
run: npm run test:integration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,7 @@ vendor/ | |
|
||
# PHPUnit | ||
.phpunit.cache/ | ||
.phpunit.result.cache | ||
|
||
# Editors | ||
.idea/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.