From 89f278018819c77cbb2ce1903ea6aabd1e01f2fd Mon Sep 17 00:00:00 2001 From: Giacomo Secchi Date: Wed, 28 Feb 2024 18:44:51 +0100 Subject: [PATCH] Setup PHPUnit --- package.json | 1 + phpunit.xml.dist | 4 +++- tests/bootstrap.php | 21 ++++++++++++++------- tests/test-sample.php | 4 ++-- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index f1e7756..2abfbff 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "plugin-zip": "wp-scripts plugin-zip", "start": "wp-scripts start --webpack-copy-php", "start:hot": "wp-scripts start --hot", + "test:unit": "wp-env run tests-cli --env-cwd=wp-content/plugins/write-poetry ./vendor/bin/phpunit", "wp-env": "wp-env", "env:start": "wp-env start && (npm run start)", "env:start:debug": "wp-env start --xdebug", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 44f0fdb..50421ec 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,3 +1,4 @@ + - + ./tests/ + ./tests/test-sample.php diff --git a/tests/bootstrap.php b/tests/bootstrap.php index ef3bd9d..c45a3ea 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,8 +1,8 @@ assertTrue( true ); }