Commit 9b2e787fcbe for woocommerce
commit 9b2e787fcbea26fc0350602171105118d093ecbe
Author: Pavel Dohnal <pavel.dohnal@automattic.com>
Date: Tue Nov 10 08:05:48 2026 +0100
Run WooCommerce tests for email editor PHP package changes (#70783)
* Run email editor package PHP tests on PHP 7.4 in CI
MailPoet still supports PHP 7.4, but the package tests ran only on 8.1,
so code using newer PHP features could pass CI and fail on those sites.
* Run WooCommerce tests for email editor PHP package changes
The PHP package is a Composer path repo, so the CI job graph did not
see it and a package-only PR skipped the WooCommerce PHP and E2E jobs.
A workspace dev dependency adds it to the graph. PHP jobs opt in through
onlyForDependencies, so no other package starts triggering them.
* Trigger email editor PHP tests on PHPUnit config changes
The job filter named phpunit.xml, which the package does not have, so
a PR changing only phpunit.xml.dist or phpunit-integration.xml.dist
started no package tests.
diff --git a/packages/php/email-editor/changelog/wooplug-8213-email-editor-ci-triggers b/packages/php/email-editor/changelog/wooplug-8213-email-editor-ci-triggers
new file mode 100644
index 00000000000..8a0ae683978
--- /dev/null
+++ b/packages/php/email-editor/changelog/wooplug-8213-email-editor-ci-triggers
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+Comment: Run the package PHP tests on PHP 7.4 in CI; no production change.
+
diff --git a/packages/php/email-editor/package.json b/packages/php/email-editor/package.json
index cd11dad3ac2..f9dafecf561 100644
--- a/packages/php/email-editor/package.json
+++ b/packages/php/email-editor/package.json
@@ -42,7 +42,7 @@
"composer.json",
"composer.lock",
"**/*.php",
- "phpunit.xml",
+ "phpunit*.xml.dist",
".wp-env.json"
],
"testEnv": {
@@ -57,6 +57,29 @@
"push"
]
},
+ {
+ "name": "PHP: 7.4 WP: latest",
+ "testType": "unit:php",
+ "command": "test:php:ci",
+ "changes": [
+ "composer.json",
+ "composer.lock",
+ "**/*.php",
+ "phpunit*.xml.dist",
+ ".wp-env.json"
+ ],
+ "testEnv": {
+ "start": "env:test",
+ "config": {
+ "phpVersion": "7.4",
+ "wpVersion": "latest"
+ }
+ },
+ "events": [
+ "pull_request",
+ "push"
+ ]
+ },
{
"name": "PHPStan: PHP 7.4",
"testType": "static:analysis",
diff --git a/plugins/woocommerce/changelog/wooplug-8213-email-editor-ci-triggers b/plugins/woocommerce/changelog/wooplug-8213-email-editor-ci-triggers
new file mode 100644
index 00000000000..29bd9ea313b
--- /dev/null
+++ b/plugins/woocommerce/changelog/wooplug-8213-email-editor-ci-triggers
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+Comment: Run WooCommerce PHP and E2E tests for email editor PHP package changes; no production change.
+
diff --git a/plugins/woocommerce/package.json b/plugins/woocommerce/package.json
index 6bd94c1794f..1c4a63036b8 100644
--- a/plugins/woocommerce/package.json
+++ b/plugins/woocommerce/package.json
@@ -157,7 +157,9 @@
"testType": "unit:php",
"command": "test:php:env",
"shardingArguments": [],
- "onlyForDependencies": [],
+ "onlyForDependencies": [
+ "@woocommerce/email-editor-config"
+ ],
"changes": [
"client/admin/config/*.json",
"client/blocks/packages/public-api/blocks-checkout/utils/validation/test/postcode-validation-fixtures.json",
@@ -189,7 +191,9 @@
"testType": "unit:php",
"command": "test:php:env",
"shardingArguments": [],
- "onlyForDependencies": [],
+ "onlyForDependencies": [
+ "@woocommerce/email-editor-config"
+ ],
"changes": [
"client/admin/config/*.json",
"client/blocks/packages/public-api/blocks-checkout/utils/validation/test/postcode-validation-fixtures.json",
@@ -221,7 +225,9 @@
"testType": "unit:php",
"command": "test:php:env",
"shardingArguments": [],
- "onlyForDependencies": [],
+ "onlyForDependencies": [
+ "@woocommerce/email-editor-config"
+ ],
"changes": [
"client/admin/config/*.json",
"client/blocks/packages/public-api/blocks-checkout/utils/validation/test/postcode-validation-fixtures.json",
@@ -1535,6 +1541,7 @@
"@typescript-eslint/eslint-plugin": "^8.63.0",
"@typescript-eslint/parser": "^8.63.0",
"@woocommerce/e2e-utils-playwright": "workspace:*",
+ "@woocommerce/email-editor-config": "workspace:*",
"@woocommerce/eslint-config": "workspace:*",
"@woocommerce/eslint-plugin": "workspace:*",
"@woocommerce/internal-build": "workspace:*",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 479346497f4..747be220e92 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -2632,6 +2632,9 @@ importers:
'@woocommerce/e2e-utils-playwright':
specifier: workspace:*
version: link:../../packages/js/e2e-utils-playwright
+ '@woocommerce/email-editor-config':
+ specifier: workspace:*
+ version: link:../../packages/php/email-editor
'@woocommerce/eslint-config':
specifier: workspace:*
version: link:../../tools/eslint-config