Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

SSR: Experiment with WP_HTML_Tag_Processor #125

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
1917c73
Add PHPUnit files from Gutenberg
ockham Dec 19, 2022
17b195c
Install phpunit and phpunit-polyfills
ockham Dec 22, 2022
1c33533
Upgrade wordpress/env to 5.8.0
ockham Dec 22, 2022
c7f5b88
Comment out some stuff in PHPUnit bootstrap
ockham Dec 19, 2022
117a0b2
Add mappings to .wp-env.json
ockham Dec 19, 2022
e37b622
Add test:unit:php script
ockham Dec 22, 2022
68816ab
More permissive unit test names
ockham Dec 19, 2022
88ea2d2
Add unit-test.yml workflow from Gutenberg
ockham Dec 19, 2022
95991e9
Trim down unit test workflow
ockham Dec 19, 2022
669bcdc
Workflow: Install composer dependencies
ockham Dec 19, 2022
136bc17
Copy directives from #118
ockham Dec 22, 2022
fde1f0e
Copy directives unit tests from #118
ockham Dec 22, 2022
84279f1
Add WP_HTML_Tag_Processor files from GB trunk
ockham Dec 22, 2022
2987d69
No need for WP_HTML_Tag_Processor at the moment
ockham Dec 22, 2022
a8fa768
Add directive processing loop
ockham Dec 22, 2022
a25b404
Format PHP
ockham Jan 2, 2023
a83600a
Use GB's WP_HTML_Tag_Processor
ockham Jan 3, 2023
55926f7
Use get_attribute_names_with_prefix
ockham Jan 3, 2023
7c92ef2
Add basic stub for wp-class
ockham Jan 3, 2023
a025490
Add .DS_Store to .gitignore
ockham Jan 3, 2023
75a7fe8
More test coverage for wp-class
ockham Jan 3, 2023
a4488e2
Verify that inexistant class isn't removed
ockham Jan 3, 2023
c6232cf
Update currently-disabled assertions
ockham Jan 3, 2023
183c4cb
Don't pass references to function
ockham Jan 4, 2023
c22e9ae
No need to pass objects by reference to function
ockham Jan 4, 2023
128cf3b
Format PHP
ockham Jan 5, 2023
69fc131
Implement basic wp-style directive
ockham Jan 5, 2023
8e0be0e
Enable assertions now that GB 14.9 is available
ockham Jan 5, 2023
9ac2496
wp-data -> wp-show
ockham Jan 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Unit Tests

on:
pull_request:
push:
branches:
- 'main*'

# 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:
unit-php:
name: PHP
runs-on: ubuntu-latest
if: ${{ github.repository == 'WordPress/block-hydration-experiments' || github.event_name == 'pull_request' }}

steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0

- name: Install Composer dependencies
run: |
composer install

- name: Use desired version of NodeJS
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # v3.5.1
with:
node-version: 14
cache: npm

- name: Npm install and build
run: |
npm ci
npm run build

- name: Run WordPress
run: |
npm run wp-env start

- name: Running single site unit tests
run: npm run test:unit:php
if: ${{ success() || failure() }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
node_modules
build
vendor
Expand Down
7 changes: 7 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,12 @@
],
"config": {
"SCRIPT_DEBUG": true
},
"env": {
"tests": {
"mappings": {
"wp-content/plugins/block-hydration-experiments": "."
}
}
}
}
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
"squizlabs/php_codesniffer": "^3.5",
"phpcompatibility/phpcompatibility-wp": "^2.1.3",
"wp-coding-standards/wpcs": "^2.2",
"sirbrillig/phpcs-variable-analysis": "^2.8"
"sirbrillig/phpcs-variable-analysis": "^2.8",
"phpunit/phpunit": "^9.5",
"yoast/phpunit-polyfills": "^1.0"
},
"require": {
"composer/installers": "~1.0"
Expand Down
Loading