[wp-trac] [WordPress Trac] #46149: PHPUnit 8.x support
WordPress Trac
noreply at wordpress.org
Fri Aug 6 19:34:36 UTC 2021
#46149: PHPUnit 8.x support
-------------------------------------------------+-------------------------
Reporter: SergeyBiryukov | Owner: netweb
Type: task (blessed) | Status: assigned
Priority: high | Milestone: 5.9
Component: Build/Test Tools | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests early php8 | Focuses:
needs-dev-note |
-------------------------------------------------+-------------------------
Comment (by thomasplevy):
Test suites running on PHP8 for my plugin utilize tests lib on the
trunk/master branch in order to work around compatibility issues with
building our plugin test suites off the top of the WP core test suite....
Maybe this was short sighted but I needed php8 unit tests working and this
was the fastest way to get it working.
The PHPUnit polyfills works wonderfully. Thank you for all this hard work.
After suites started failing yesterday I started looking into what's going
on and found my way here.
I've added the https://github.com/Yoast/PHPUnit-Polyfills as a dependency
for my own project (since I install via install-wp-tests.sh (as noted
above). However. I've chosen to install my test stuff in a separate
directory that gets ignored from version control. As a result the
reference to the autoloader assumes installation in the root directory and
I can't get it working without forking the bootstrap file.
I'd like to propose a configurable vendor directory constant in the
bootstrap file (similar to how the wp-tests-config.php file can be
configured with a constant (https://github.com/WordPress/wordpress-
develop/commit/1e88432e34a5c8405c75e5a56977362766b4cf95)
This would allow me to add a custom vendor directory in my `phpunit.xml`.
I've written (and tested) a patch that will allow this kind of setup and
doesn't break the core tests lib (attached)
Would this be an acceptable addition to help someone in my position. Maybe
I'm the only silly guy to install in a different directory...
--
Ticket URL: <https://core.trac.wordpress.org/ticket/46149#comment:70>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list