Skip to content

Commit 137ba85

Browse files
Merge branch 'WordPress:master' into master
2 parents e03c42a + 7fc2227 commit 137ba85

17 files changed

+5853
-85
lines changed

.github/workflows/unit-test.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Unit Tests
2+
3+
on:
4+
pull_request:
5+
push:
6+
workflow_dispatch:
7+
8+
jobs:
9+
test-php:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
php:
15+
- '7.4'
16+
17+
env:
18+
WP_ENV_PHP_VERSION: ${{ matrix.php }}
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Install
25+
run: npm install
26+
27+
- name: Setup Environment
28+
run: |
29+
rm composer.lock
30+
npm run setup
31+
32+
- name: Test
33+
run: npm run test

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
vendor
1+
vendor
2+
coverage
3+
node_modules

.travis.yml

-35
This file was deleted.

.wp-env.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"phpVersion": "7.4",
3+
"plugins": [
4+
".",
5+
"https://downloads.wordpress.org/plugin/posts-to-posts.latest-stable.zip"
6+
]
7+
}

composer.json

+17
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,25 @@
2828
"scribu/scb-framework" : "dev-master@dev",
2929
"psr/log" : "~1.0"
3030
},
31+
"require-dev" : {
32+
"phpunit/phpunit": "^7",
33+
"spatie/phpunit-watcher": "^1.23",
34+
"yoast/phpunit-polyfills": "^1.0"
35+
},
36+
"scripts" : {
37+
"test": "phpunit",
38+
"test:watch": "phpunit-watcher watch < /dev/tty",
39+
"test:coverage": "php -d xdebug.mode=coverage ./vendor/bin/phpunit --coverage-html coverage"
40+
},
3141
"autoload" : {
3242
"classmap": ["lib"],
3343
"files" : ["lib/runner.php", "lib/template.php"]
44+
},
45+
"config": {
46+
"allow-plugins": {
47+
"composer/installers": true
48+
},
49+
"_process-timeout-comment": "Work around `test:watch` timeout, see https://github.com/spatie/phpunit-watcher/issues/63#issuecomment-545633709",
50+
"process-timeout": 0
3451
}
3552
}

0 commit comments

Comments
 (0)