From c00ab454fa2902678b1213735ed24ba5c7b41029 Mon Sep 17 00:00:00 2001 From: Glen Davies Date: Thu, 20 Jul 2023 14:20:26 +1200 Subject: [PATCH] add options for debugging php unit tests --- package.json | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 204e02b3bb7d96..e91a45d78d55a1 100644 --- a/package.json +++ b/package.json @@ -326,10 +326,14 @@ "test:unit:date": "bash ./bin/unit-test-date.sh", "test:unit:debug": "wp-scripts --inspect-brk test-unit-js --runInBand --no-cache --verbose --config test/unit/jest.config.js ", "test:unit:profile": "wp-scripts --cpu-prof test-unit-js --runInBand --no-cache --verbose --config test/unit/jest.config.js ", - "pretest:unit:php": "wp-env start", - "test:unit:php": "wp-env run --env-cwd='wp-content/plugins/gutenberg' tests-wordpress vendor/bin/phpunit -c phpunit.xml.dist --verbose", - "pretest:unit:php:multisite": "wp-env start", - "test:unit:php:multisite": "wp-env run --env-cwd='wp-content/plugins/gutenberg' tests-wordpress vendor/bin/phpunit -c phpunit/multisite.xml --verbose", + "test:unit:php:setup": "wp-env start", + "test:unit:php:setup:debug": "wp-env start --xdebug", + "test:unit:php:base": "wp-env run --env-cwd='wp-content/plugins/gutenberg' tests-wordpress vendor/bin/phpunit -c phpunit.xml.dist --verbose", + "test:unit:php": "npm-run-all test:unit:php:setup test:unit:php:base", + "test:unit:php:debug": "npm-run-all test:unit:php:setup:debug test:unit:php:base", + "test:unit:php:multisite:base": "wp-env run --env-cwd='wp-content/plugins/gutenberg' tests-wordpress vendor/bin/phpunit -c phpunit/multisite.xml --verbose", + "test:unit:php:multisite": "npm-run-all test:unit:php:setup test:unit:php:multisite:base", + "test:unit:php:multisite:debug": "npm-run-all test:unit:php:setup:debug test:unit:php:multisite:base", "test:unit:update": "npm run test:unit -- --updateSnapshot", "test:unit:watch": "npm run test:unit -- --watch", "wp-env": "wp-env"