I'm not sure if this should be handled here or via a separate stub repo, but I'm wondering if it would make sense to create a stub for the WordPress core test suite codebase.
The main use-case here would be for developers writing code that extends the WP_UnitTestCase
class โ the WordPress instance itself will generally be installed to a tmp/
directory (or /srv/www/wordpress-develop
in environments like VVV), putting it outside of the typical project scope. As a result, tools like Intelephense which, as best I can tell, uses this library for its WordPress stubs, flag a lot of standard PHPUnit code as error-filled because it doesn't know that WP_UnitTestCase
extends PHPUnit\Framework\TestCase
:
![Intelephense errors related to undefined PHPUnit methods](https://user-images.githubusercontent.com/233836/140787812-474e97bc-838e-403e-9e4b-d57b922bd539.png)
Granted this is a bit of a niche use-case, but in the interest of encouraging better testing practices in WordPress I think it's worth a discussion ๐.