#58955 closed task (blessed) (fixed)
Test tool and unit test improvements for 6.4
Reported by: | SergeyBiryukov | Owned by: | |
---|---|---|---|
Milestone: | 6.4 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Build/Test Tools | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description
Previously:
- #57841 (6.3)
- #56793 (6.2)
- #55652 (6.1)
- #54725 (6.0)
- #53363 (5.9)
- #52625 (5.8)
- #51802 (5.7)
- #51344 (5.6)
This ticket is for various fixes and improvements in PHPUnit tests that don't have a more specific ticket, as well as general improvements to the GitHub Actions workflows that run automated testing.
Attachments (1)
Change History (16)
This ticket was mentioned in PR #4954 on WordPress/wordpress-develop by @hellofromTonya.
13 months ago
#1
- Keywords has-patch has-unit-tests added
@hellofromTonya commented on PR #4954:
13 months ago
#3
Committed via https://core.trac.wordpress.org/changeset/56348.
This ticket was mentioned in PR #5100 on WordPress/wordpress-develop by @johnbillion.
13 months ago
#5
Trac ticket: https://core.trac.wordpress.org/ticket/58955
This changes several instances of test skipping to test failures, and removes some unnecessary function_exists()
checks for compat functions.
If any of the checks in these test aren't satisfied then the test should fail rather than be skipped.
#6
@
12 months ago
Attaching a patch containing some initial work to improve the @group
notation accuracy and consistency across the tests. Team work made during a mob-coding session together with @SergeyBiryukov, @aristath, and @poena.
This ticket was mentioned in PR #4132 on WordPress/wordpress-develop by @Rahmohn.
12 months ago
#7
This PR updates the test test_wp_count_attachments_should_cache_the_result
to check the properties of the object returned instead of checking the object with assertEquals
. That way, we guarantee the expected properties of the object.
Trac ticket: https://core.trac.wordpress.org/ticket/58955
Fixes tests leaking into other tests by:
$hook_suffix
global value. Rather than modifying the global for all tests, restore the original value between tests. Why? To ensure each test starts at a known state.WP_List_Table
for each test. A test may modify the $list_table object. If it does, it could impact tests yet to run. By instantiating a new instance in theset_up()
test fixture, each test is isolated from the others.Note: This was original found and resolved in https://github.com/WordPress/wordpress-develop/pull/4905, but the fix is unrelated to that scope of work. Separating the fix for its own commit.
Trac ticket: https://core.trac.wordpress.org/ticket/58955