Skip to content

Commit 7ed3e92

Browse files
dd32claude
andcommitted
Fix PHPUnit execution inside wp-env container
- Set --env-cwd to the plugin directory so PHPUnit finds phpunit.xml.dist - Remove convertDeprecationsToExceptions attribute for PHPUnit 10 compat Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 038a036 commit 7ed3e92

3 files changed

Lines changed: 2 additions & 3 deletions

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
WP_ENV_LIFECYCLE_TIMEOUT: 300
6969

7070
- name: Run PHP tests via wp-env
71-
run: npx wp-env run tests-cli phpunit
71+
run: npx wp-env run tests-cli --env-cwd=wp-content/plugins/multi-author-posts phpunit
7272

7373
- name: Stop wp-env
7474
if: always()

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"build": "wp-scripts build",
99
"start": "wp-scripts start",
1010
"test:unit": "wp-scripts test-unit-js --testPathPattern=tests/js",
11-
"test:php": "wp-env run tests-cli phpunit",
11+
"test:php": "wp-env run tests-cli --env-cwd=wp-content/plugins/multi-author-posts phpunit",
1212
"test": "npm run test:unit && npm run test:php",
1313
"env:start": "wp-env start",
1414
"env:stop": "wp-env stop",

phpunit.xml.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.6/phpunit.xsd"
55
bootstrap="tests/bootstrap.php"
66
colors="true"
7-
convertDeprecationsToExceptions="false"
87
>
98
<testsuites>
109
<testsuite name="php">

0 commit comments

Comments
 (0)