Skip to content

Commit

Permalink
Adds wpunit-helpers as dev dependency (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzsequence authored Jan 17, 2025
1 parent c0b458a commit 9460a00
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 15 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,16 @@ jobs:
run: |
composer install
npm install
- name: Setup MySQL
- name: Start MySQL
run: |
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE IF NOT EXISTS wordpress_test;' -uroot -proot
mysql -e 'SHOW DATABASES;' -uroot -proot
- name: Install WP Unit tests
run: |
php -v
mysqladmin -V
bash .bin/install-wp-tests.sh wordpress_test root root localhost latest true
- name: Setup WP-CLI
uses: godaddy-wordpress/setup-wp-cli@1
- name: Run linter
run: composer lint
- name: Run tests
run: composer test
run: bash ./bin/phpunit-test.sh
wporg-code-analysis:
runs-on: ubuntu-latest
name: WP.org Code Analysis
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ node_modules/

/vendor/

# WPUnit Helpers
bin/helpers.sh
bin/install-local-tests.sh
bin/install-wp-tests.sh
bin/phpunit-test.sh

# Built files
assets/css/*.css
assets/css/*.css.map
Expand Down
10 changes: 7 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"pantheon-systems/pantheon-wp-coding-standards": "^2.0",
"pantheon-systems/pantheon-wordpress-upstream-tests": "dev-master",
"phpunit/phpunit": "^9",
"yoast/phpunit-polyfills": "^1.0"
"yoast/phpunit-polyfills": "^1.0",
"pantheon-systems/wpunit-helpers": "^2.0"
},
"scripts": {
"lint": [
Expand All @@ -26,11 +27,14 @@
"phpcs": "vendor/bin/phpcs -s .",
"phpcbf": "vendor/bin/phpcbf",
"phpunit": "vendor/bin/phpunit",
"test": "@phpunit"
"test": "@phpunit",
"test:install": "bin/install-local-tests.sh --skip-db=true",
"test:install:withdb": "bin/install-local-tests.sh"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
"dealerdirect/phpcodesniffer-composer-installer": true,
"pantheon-systems/wpunit-helpers": true
}
}
}
54 changes: 50 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9460a00

Please sign in to comment.