GithubHelp home page GithubHelp logo

php-stubs / wordpress-tests-stubs Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 0.0 279 KB

WordPress core test suite function and class declaration stubs for static analysis by PHPStan

Home Page: https://packagist.org/packages/php-stubs/wordpress-tests-stubs

License: MIT License

PHP 99.11% Shell 0.89%

wordpress-tests-stubs's People

Contributors

stevegrunwell avatar swissspidy avatar szepeviktor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

wordpress-tests-stubs's Issues

Include WP Core test suite tooling in stubs?

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

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 ๐Ÿ˜„.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.