Automattic / Automattic/jetpack

Packages: offer standardized way to set up WordPress / run WordPress PHPUnit tests within a package

Open
#19,841 3 comments 0 reactions 0 assignees View on GitHub
General Task Unit Tests
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 14h
Merged PRs (30d)
790

Description

Until now, we've relied on 2 packages to help us with unit tests inside our PHP packages:
- https://github.com/Automattic/wordbless
- https://github.com/Brain-WP/BrainMonkey

While those 2 options work, they do not offer the full WordPress core PHPUnit test library that is included with WordPress' development environment:
https://github.com/WordPress/wordpress-develop/tree/master/tests/phpunit

That's sometimes problematic, for example when wanting to develop tests against functions that use `WP_Query` for example: #19579

It would be nice to come up with a solution that we can agree on, and that we would rely on for most packages. Maybe something like https://github.com/wp-phpunit/wp-phpunit

Contributor guide

Open the contributing guide

Research direction

Start by comparing the existing wordbless and BrainMonkey approaches with the WordPress core PHPUnit library in wordpress-develop/tests/phpunit. Review the wp-phpunit option and the context in #19579 to identify package requirements and compatibility concerns. Done means documenting or implementing an agreed standardized way for packages to set up WordPress and run the full PHPUnit test library.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.