-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Open
Labels
[Type] Automated TestingTesting infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.[Type] OverviewComprehensive, high level view of an area of focus often with multiple tracking issuesComprehensive, high level view of an area of focus often with multiple tracking issues
Description
This is an epic ticket to track ongoing roadmap to increase the PHP test suite parity with WordPress Core.
Updates:
- 17 Aug 2022: Initially created.
Scope
WordPress Core' PHP tests:
- Run against all supported PHP versions (currently 5.6 to 8.1)
- Use PHPUnit Polyfills to match the PHPUnit and PHP versions
- Use the WordPress Core test coding standards including:
- the standards for file structures, file naming, and test class naming
- preferred assertions such as
assertSame()instead ofassertEquals() - renaming of the shared fixtures
- use of data providers
- annotations including
@coversfor code coverage
- With PHP notices and deprecations turned on for awareness and testing
The scope of this roadmap is to upgrade the Gutenberg PHP unit tests for parity to WordPress Core.
Why? Benefits
- Reduce backporting effort by getting tests Core-ready long before backporting starts.
- To promote discovery of potential issues and incompatibilities earlier and continuously through the development and testing cycles.
- To increase commonality for Core contributors to more easily contribute to Gutenberg.
Ongoing Work
- PHPUnit: turns on PHP notices and deprecations #43102
- PHPUnit: Let PHPUnit Polyfills match PHPUnit version #43334
- Run PHPUnit jobs across multiple PHP versions #46510
- GitHub workflows: parity with Core #48603
- Reorganize and rename test files and classes to Core's test coding standards
- Audit shared fixtures and resolve any mismatches
- Audit tests and convert into data providers where appropriate
- Add failure messages when a test method has more than 1 assertion or expectation
- Enforce checks against redeclaration for functions and classes #52696
- Document the naming convention for
block-libraryPHP functions #53777 - Enforce valid function names in the packages/block-library/src/*/*.php files #53438
- Refactor unit tests in the
gutenberg/gutenberg-coding-standardspackage
ironprogrammer, gziolo, Soean, ockham, desrosj and 1 more
Metadata
Metadata
Assignees
Labels
[Type] Automated TestingTesting infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.[Type] OverviewComprehensive, high level view of an area of focus often with multiple tracking issuesComprehensive, high level view of an area of focus often with multiple tracking issues