Commit 816ba114dd3 for woocommerce
commit 816ba114dd3f2915050cc4b6e08284606d256062
Author: Adrian Moldovan <3854374+adimoldovan@users.noreply.github.com>
Date: Thu Jul 9 12:42:11 2026 +0300
Exclude email-template test fixtures from PHPUnit discovery (#66427)
diff --git a/plugins/woocommerce/changelog/php-tests-email-fixture-stdout-leak b/plugins/woocommerce/changelog/php-tests-email-fixture-stdout-leak
new file mode 100644
index 00000000000..dc9480136cd
--- /dev/null
+++ b/plugins/woocommerce/changelog/php-tests-email-fixture-stdout-leak
@@ -0,0 +1,4 @@
+Significance: patch
+Type: dev
+
+Exclude email-template test fixtures from PHPUnit discovery so they no longer print markup to stdout during suite construction.
diff --git a/plugins/woocommerce/phpunit.xml b/plugins/woocommerce/phpunit.xml
index 6b50659022a..fe270828137 100644
--- a/plugins/woocommerce/phpunit.xml
+++ b/plugins/woocommerce/phpunit.xml
@@ -23,6 +23,11 @@
<directory suffix=".php">./tests/php</directory>
<exclude>./tests/php/helpers</exclude>
<exclude>./tests/php/src/Blocks/BlockPatterns/patterns</exclude>
+ <!-- Email-template fixtures are plain PHP that emit markup at
+ include-time (top-level HTML and `echo`). PHPUnit's directory
+ discovery `require`s every matched `.php` file, so leaving them
+ in would print their output to stdout during suite construction. -->
+ <exclude>./tests/php/src/Internal/EmailEditor/WCTransactionalEmails/fixtures</exclude>
<!-- Enumerated rather than a blanket ./tests/php/src/Api, so a new
./tests/php/src/Api/<X>/ subdir surfaces in this suite instead
of being silently dropped from every suite but wc-phpunit-full.
@@ -57,6 +62,11 @@
<directory suffix=".php">./tests/php</directory>
<exclude>./tests/php/helpers</exclude>
<exclude>./tests/php/src/Blocks/BlockPatterns/patterns</exclude>
+ <!-- Email-template fixtures are plain PHP that emit markup at
+ include-time (top-level HTML and `echo`). PHPUnit's directory
+ discovery `require`s every matched `.php` file, so leaving them
+ in would print their output to stdout during suite construction. -->
+ <exclude>./tests/php/src/Internal/EmailEditor/WCTransactionalEmails/fixtures</exclude>
<exclude>./tests/php/src/Api/Infrastructure</exclude>
<exclude>./tests/php/src/Api/Queries</exclude>
<exclude>./tests/php/src/Api/Mutations</exclude>
@@ -67,6 +77,11 @@
<directory suffix=".php">./tests/php</directory>
<exclude>./tests/php/helpers</exclude>
<exclude>./tests/php/src/Blocks/BlockPatterns/patterns</exclude>
+ <!-- Email-template fixtures are plain PHP that emit markup at
+ include-time (top-level HTML and `echo`). PHPUnit's directory
+ discovery `require`s every matched `.php` file, so leaving them
+ in would print their output to stdout during suite construction. -->
+ <exclude>./tests/php/src/Internal/EmailEditor/WCTransactionalEmails/fixtures</exclude>
</testsuite>
</testsuites>
<listeners>