Skip to content

Commit e2ee085

Browse files
committed
Merge branch 'develop'
2 parents 00f039f + 721f060 commit e2ee085

25 files changed

+2049
-762
lines changed

.gitattributes

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
# Files
2-
/.distignore export-ignore
3-
/.editorconfig export-ignore
4-
/.gitattributes export-ignore
5-
/.gitignore export-ignore
6-
/.travis.yml export-ignore
7-
/composer.json export-ignore
8-
/composer.lock export-ignore
9-
/package.json export-ignore
10-
/package-lock.json export-ignore
11-
/phpcs.ruleset.xml export-ignore
12-
/phpmd.ruleset.xml export-ignore
13-
/phpstan.neon export-ignore
14-
/phpunit.xml export-ignore
15-
/README.md export-ignore
2+
/.distignore export-ignore
3+
/.editorconfig export-ignore
4+
/.gitattributes export-ignore
5+
/.gitignore export-ignore
6+
/.travis.yml export-ignore
7+
/composer.json export-ignore
8+
/composer.lock export-ignore
9+
/package.json export-ignore
10+
/package-lock.json export-ignore
11+
/phpcs.ruleset.xml export-ignore
12+
/phpmd.ruleset.xml export-ignore
13+
/phpstan.neon export-ignore
14+
/phpunit.xml export-ignore
15+
/phpunit-legacy.xml export-ignore
16+
/README.md export-ignore
1617

1718
# Directories
1819
/.github export-ignore

.github/workflows/wp-plugin-unit-test.yml

Lines changed: 74 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
matrix:
2525
os: [ ubuntu-20.04 ]
26-
php: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4' ]
26+
php: [ '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
2727
wordpress: [ latest, nightly ]
2828
multisite: [ 0 ]
2929

@@ -61,7 +61,9 @@ jobs:
6161
- name: Install PHPUnit
6262
run: |
6363
# for PHP Compatibility - https://phpunit.de/supported-versions.html
64-
if [[ $PHP_VERSION == "7.0" ]] ; then
64+
if [[ ${PHP_VERSION:0:1} == "8" ]] ; then
65+
composer global require "phpunit/phpunit=8.*"
66+
elif [[ $PHP_VERSION == "7.0" ]] ; then
6567
composer global require "phpunit/phpunit=5.7.*|6.*"
6668
# for WP_VERSION < 4.6 due to PHP Fatal error: Class 'PHPUnit_Framework_TestCase' not found
6769
elif [[ ${PHP_VERSION:0:1} == "7" ]] && [[ "$WP_VERSION" < 4.6* ]] ; then
@@ -74,10 +76,78 @@ jobs:
7476
fi
7577
7678
- name: Install PHPUnit Polyfills library
77-
run: composer global require "yoast/phpunit-polyfills=1.0.3"
79+
run: composer global require "yoast/phpunit-polyfills=1.1.0"
7880

7981
- name: Install wp tests
8082
run: bash bin/install-wp-tests.sh wordpress_test root root 0.0.0.0:3306 $WP_VERSION
8183

8284
- name: Run PHPUnit - WordPress ${{ matrix.wordpress }} * Multisite ${{ matrix.multisite }}
83-
run: phpunit
85+
run: |
86+
if [[ $PHP_VERSION == "5.6" ]] || [[ $PHP_VERSION == "7.0" ]] ; then
87+
phpunit --configuration phpunit-legacy.xml
88+
else
89+
phpunit
90+
fi
91+
92+
phpunit-legacy:
93+
name: WordPress ${{ matrix.wordpress }} * PHP v${{ matrix.php }} * ${{ matrix.os }} * Multisite ${{ matrix.multisite }}
94+
runs-on: ${{ matrix.os }}
95+
timeout-minutes: 30
96+
97+
strategy:
98+
fail-fast: false
99+
100+
matrix:
101+
os: [ ubuntu-20.04 ]
102+
# WordPress 6.3 or later requires at least 7.0.0
103+
php: [ '5.6' ]
104+
wordpress: [ '6.1', '6.2' ]
105+
multisite: [ 0 ]
106+
107+
env:
108+
PHP_VERSION: ${{ matrix.php }}
109+
WP_VERSION: ${{ matrix.wordpress }}
110+
WP_MULTISITE: ${{ matrix.multisite }}
111+
112+
services:
113+
database:
114+
image: mysql:5.7
115+
ports:
116+
- 3306:3306
117+
env:
118+
MYSQL_ROOT_PASSWORD: root
119+
120+
steps:
121+
- uses: actions/checkout@v3
122+
123+
- name: Setup PHP v${{ matrix.php }}
124+
uses: shivammathur/setup-php@v2
125+
with:
126+
php-version: ${{ matrix.php }}
127+
extensions: mbstring, intl, php-mysql
128+
129+
- name: Install PHPUnit
130+
run: |
131+
# for PHP Compatibility - https://phpunit.de/supported-versions.html
132+
if [[ ${PHP_VERSION:0:1} == "8" ]] ; then
133+
composer global require "phpunit/phpunit=8.*"
134+
elif [[ $PHP_VERSION == "7.0" ]] ; then
135+
composer global require "phpunit/phpunit=5.7.*|6.*"
136+
# for WP_VERSION < 4.6 due to PHP Fatal error: Class 'PHPUnit_Framework_TestCase' not found
137+
elif [[ ${PHP_VERSION:0:1} == "7" ]] && [[ "$WP_VERSION" < 4.6* ]] ; then
138+
composer global require "phpunit/phpunit=5.7.*"
139+
# for WP_VERSION < 5.0 due to Fatal error: Class PHPUnit_Util_Test may not inherit from final class (PHPUnit\Util\Test)
140+
elif [[ ${PHP_VERSION:0:1} == "7" ]] && [[ "$WP_VERSION" < 5.0* ]] ; then
141+
composer global require "phpunit/phpunit=5.7.*|6.*"
142+
else
143+
composer global require "phpunit/phpunit=4.8.*|5.4.*|5.7.*|6.*|7.*"
144+
fi
145+
146+
- name: Install PHPUnit Polyfills library
147+
run: composer global require "yoast/phpunit-polyfills=1.1.0"
148+
149+
- name: Install wp tests
150+
run: bash bin/install-wp-tests.sh wordpress_test root root 0.0.0.0:3306 $WP_VERSION
151+
152+
- name: Run PHPUnit - WordPress ${{ matrix.wordpress }} * Multisite ${{ matrix.multisite }}
153+
run: phpunit --configuration phpunit-legacy.xml

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
"wp-coding-standards/wpcs": "2.*",
88
"phpmd/phpmd": "2.*",
99
"phpstan/phpstan": "*",
10-
"phpunit/phpunit": "^7",
10+
"phpunit/phpunit": "^8",
1111
"phpcompatibility/phpcompatibility-wp": "*",
12-
"yoast/phpunit-polyfills": "^1.0.3"
12+
"yoast/phpunit-polyfills": "^1.1.0"
1313
},
1414
"prefer-stable" : true,
1515
"scripts": {

0 commit comments

Comments
 (0)