Skip to content

Commit

Permalink
Fix php since wp-env changed
Browse files Browse the repository at this point in the history
  • Loading branch information
johnstonphilip committed May 19, 2023
1 parent ffbad96 commit 95b638c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ build
/phpcs.xml
/.wp-env.json
/.wp-env.json.bak
.phpunit.result.cache
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"test:js": "wp-scripts test-unit-js"
},
"devDependencies": {
"@wordpress/env": "^4.3.1",
"@wordpress/env": "^7.0.0",
"@wordpress/eslint-plugin": "^12.4.0",
"@wordpress/jest-preset-default": "^8.1.1",
"@wordpress/scripts": "24.0.0"
Expand Down
7 changes: 2 additions & 5 deletions phpunit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,5 @@ sed -i.bak "s/REPLACE_WITH_PLUGIN_DIR_NAME/$plugindirname/g" .wp-env.json
npx -p @wordpress/env wp-env start

# Run PHPunit inside wp-env, targeting the plugin in question.
if [ "$multisite" = "1" ]; then
npx -p @wordpress/env wp-env run phpunit "WP_MULTISITE=1 phpunit -c /var/www/html/wp-content/wpps-scripts/phpunit.xml.dist /var/www/html/wp-content/plugins/$plugindirname"
else
npx -p @wordpress/env wp-env run phpunit "phpunit -c /var/www/html/wp-content/wpps-scripts/phpunit.xml.dist /var/www/html/wp-content/plugins/$plugindirname"
fi
npx -p @wordpress/env wp-env run --env-cwd=\"wp-content/wpps-scripts\" tests-wordpress phpunit -c ./phpunit.xml.dist /var/www/html/wp-content/plugins/$plugindirname

0 comments on commit 95b638c

Please sign in to comment.