Skip to content

Commit e29cc4f

Browse files
committed
Improve local dev setup with Composer and PHPUnit in Docker container
- Remove dependency on globally installed Composer - Provide a way to install and run Composer and PHPUnit in the container created by wp-env - Start basic PHPUnit tests in addition to existing unit tests (using wp-now) and E2E tests (Playwright) - Document local dev/test/build setup
1 parent 1203ff3 commit e29cc4f

24 files changed

+2256
-334
lines changed

.gitignore

Lines changed: 10 additions & 184 deletions
Original file line numberDiff line numberDiff line change
@@ -1,197 +1,23 @@
1+
/artifacts
12
/publish
23
/vendor
34
node_modules
4-
.idea
55
*.log
66
*.local.js
77

8-
# Support any package manager
9-
composer.lock
8+
# Ignore lock files to allow any package manager
9+
bun.lock
10+
bun.lockb
1011
package-lock.json
1112
yarn.lock
12-
bun.lockb
1313

14+
# Testing
15+
/.phpunit.cache
16+
/.wp-env.override.json
1417
/artifacts
15-
*.swp
1618
/coverage
17-
/.phpunit.cache
18-
/wordpress-develop
19-
20-
# https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/#wp-env-override-json
21-
.wp-env.override.json
22-
23-
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
24-
25-
# Logs
26-
27-
logs
28-
_.log
29-
npm-debug.log_
30-
yarn-debug.log*
31-
yarn-error.log*
32-
lerna-debug.log*
33-
.pnpm-debug.log*
34-
35-
# Diagnostic reports (https://nodejs.org/api/report.html)
36-
37-
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
38-
39-
# Runtime data
40-
41-
pids
42-
_.pid
43-
_.seed
44-
\*.pid.lock
45-
46-
# Directory for instrumented libs generated by jscoverage/JSCover
47-
48-
lib-cov
49-
50-
# Coverage directory used by tools like istanbul
51-
52-
coverage
53-
\*.lcov
54-
55-
# nyc test coverage
56-
57-
.nyc_output
58-
59-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
60-
61-
.grunt
62-
63-
# Bower dependency directory (https://bower.io/)
64-
65-
bower_components
66-
67-
# node-waf configuration
68-
69-
.lock-wscript
70-
71-
# Compiled binary addons (https://nodejs.org/api/addons.html)
72-
73-
build/Release
74-
75-
# Dependency directories
76-
77-
node_modules/
78-
jspm_packages/
79-
80-
# Snowpack dependency directory (https://snowpack.dev/)
81-
82-
web_modules/
83-
84-
# TypeScript cache
85-
86-
\*.tsbuildinfo
87-
88-
# Optional npm cache directory
89-
90-
.npm
91-
92-
# Optional eslint cache
93-
94-
.eslintcache
95-
96-
# Optional stylelint cache
97-
98-
.stylelintcache
19+
/test-results
20+
wordpress-develop
9921

100-
# Microbundle cache
101-
102-
.rpt2_cache/
103-
.rts2_cache_cjs/
104-
.rts2_cache_es/
105-
.rts2_cache_umd/
106-
107-
# Optional REPL history
108-
109-
.node_repl_history
110-
111-
# Output of 'npm pack'
112-
113-
\*.tgz
114-
115-
# Yarn Integrity file
116-
117-
.yarn-integrity
118-
119-
# dotenv environment variable files
120-
121-
.env
122-
.env.development.local
123-
.env.test.local
124-
.env.production.local
125-
.env.local
126-
127-
# parcel-bundler cache (https://parceljs.org/)
128-
129-
.cache
130-
.parcel-cache
131-
132-
# Next.js build output
133-
134-
.next
135-
out
136-
137-
# Nuxt.js build / generate output
138-
139-
.nuxt
140-
dist
141-
142-
# Gatsby files
143-
144-
.cache/
145-
146-
# Comment in the public line in if your project uses Gatsby and not Next.js
147-
148-
# https://nextjs.org/blog/next-9-1#public-directory-support
149-
150-
# public
151-
152-
# vuepress build output
153-
154-
.vuepress/dist
155-
156-
# vuepress v2.x temp and cache directory
157-
158-
.temp
159-
.cache
160-
161-
# Docusaurus cache and generated files
162-
163-
.docusaurus
164-
165-
# Serverless directories
166-
167-
.serverless/
168-
169-
# FuseBox cache
170-
171-
.fusebox/
172-
173-
# DynamoDB Local files
174-
175-
.dynamodb/
176-
177-
# TernJS port file
178-
179-
.tern-port
180-
181-
# Stores VSCode versions used for testing VSCode extensions
182-
183-
.vscode-test
184-
185-
# yarn v2
186-
187-
.yarn/cache
188-
.yarn/unplugged
189-
.yarn/build-state.yml
190-
.yarn/install-state.gz
191-
.pnp.\*
192-
193-
# IntelliJ based IDEs
22+
*.swp
19423
.idea
195-
196-
# Finder (MacOS) folder config
197-
.DS_Store

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"semi": false,
3+
"singleQuote": true,
4+
"tabWidth": 2,
5+
"useTabs": false
6+
}

.wp-env.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
{
22
"core": "WordPress/WordPress",
33
"phpVersion": "8.2",
4-
"plugins": [
5-
"."
6-
],
4+
"plugins": ["."],
75
"mappings": {
8-
"wp-content/plugins/e2e-plugin": "./vendor/tangible/framework/env/e2e-plugin"
96
}
107
}

assets/build/admin.min.css

Lines changed: 1 addition & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/build/admin.min.css.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

blueprint.dev.json

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
11
{
22
"landingPage": "/wp-admin/options-general.php?page=example-plugin-settings",
33
"steps": [
4+
{
5+
"step": "setSiteOptions",
6+
"options": {
7+
"blogname": "Example Plugin",
8+
"blogdescription": ""
9+
}
10+
},
411
{
512
"step": "defineWpConfigConsts",
613
"consts": {
7-
"WP_DEBUG": true
14+
"WP_DEBUG": true
815
},
916
"method": "rewrite-wp-config"
1017
},
18+
{
19+
"step": "login",
20+
"username": "admin"
21+
},
1122
{
1223
"step": "activatePlugin",
13-
"pluginName": "E2E",
14-
"pluginPath": "/var/www/html/wp-content/plugins/e2e-plugin"
24+
"pluginName": "Example Plugin",
25+
"pluginPath": "/var/www/html/wp-content/plugins/example-plugin"
1526
}
1627
]
1728
}

composer.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"require-dev": {
3+
"phpunit/phpunit": "9.6.x-dev",
4+
"yoast/phpunit-polyfills": "2.x-dev"
5+
},
6+
"minimum-stability": "dev"
7+
}

0 commit comments

Comments
 (0)