Confidently Testing WordPress
summary
Walks through concrete steps to add automated tests to a plugin: scaffold with WP-CLI scaffold plugin-tests, run PHPUnit against the PHPUnit and WordPress core test suite, and use core factories to create users/posts and WP_Set_Current_User to impersonate roles. Demonstrates stubbing HTTP via the pre_http_request filter, using mocks/spy/stub/fake/dummy, data providers, output buffering for shortcode testing, and shows real run stats (511 tests, 1,085 assertions, 1.13 minutes, 42 MB RAM).
AI-written summary · about
