Skip to content

Commit 9460a00

Browse files
authored
Adds wpunit-helpers as dev dependency (#99)
1 parent c0b458a commit 9460a00

File tree

4 files changed

+67
-15
lines changed

4 files changed

+67
-15
lines changed

.github/workflows/lint-test.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,16 @@ jobs:
2121
run: |
2222
composer install
2323
npm install
24-
- name: Setup MySQL
24+
- name: Start MySQL
2525
run: |
2626
sudo /etc/init.d/mysql start
27-
mysql -e 'CREATE DATABASE IF NOT EXISTS wordpress_test;' -uroot -proot
28-
mysql -e 'SHOW DATABASES;' -uroot -proot
29-
- name: Install WP Unit tests
30-
run: |
31-
php -v
3227
mysqladmin -V
33-
bash .bin/install-wp-tests.sh wordpress_test root root localhost latest true
28+
- name: Setup WP-CLI
29+
uses: godaddy-wordpress/setup-wp-cli@1
3430
- name: Run linter
3531
run: composer lint
3632
- name: Run tests
37-
run: composer test
33+
run: bash ./bin/phpunit-test.sh
3834
wporg-code-analysis:
3935
runs-on: ubuntu-latest
4036
name: WP.org Code Analysis

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ node_modules/
1010

1111
/vendor/
1212

13+
# WPUnit Helpers
14+
bin/helpers.sh
15+
bin/install-local-tests.sh
16+
bin/install-wp-tests.sh
17+
bin/phpunit-test.sh
18+
1319
# Built files
1420
assets/css/*.css
1521
assets/css/*.css.map

composer.json

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"pantheon-systems/pantheon-wp-coding-standards": "^2.0",
1616
"pantheon-systems/pantheon-wordpress-upstream-tests": "dev-master",
1717
"phpunit/phpunit": "^9",
18-
"yoast/phpunit-polyfills": "^1.0"
18+
"yoast/phpunit-polyfills": "^1.0",
19+
"pantheon-systems/wpunit-helpers": "^2.0"
1920
},
2021
"scripts": {
2122
"lint": [
@@ -26,11 +27,14 @@
2627
"phpcs": "vendor/bin/phpcs -s .",
2728
"phpcbf": "vendor/bin/phpcbf",
2829
"phpunit": "vendor/bin/phpunit",
29-
"test": "@phpunit"
30+
"test": "@phpunit",
31+
"test:install": "bin/install-local-tests.sh --skip-db=true",
32+
"test:install:withdb": "bin/install-local-tests.sh"
3033
},
3134
"config": {
3235
"allow-plugins": {
33-
"dealerdirect/phpcodesniffer-composer-installer": true
36+
"dealerdirect/phpcodesniffer-composer-installer": true,
37+
"pantheon-systems/wpunit-helpers": true
3438
}
3539
}
3640
}

composer.lock

Lines changed: 50 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)