Make WordPress Core

#57958 closed task (blessed) (fixed)

PHPUnit tests: Add/improve @covers annotations for WP 6.3

Reported by: pbearne's profile pbearne Owned by: hellofromtonya's profile hellofromTonya
Milestone: 6.3 Priority: normal
Severity: normal Version: 4.8
Component: Build/Test Tools Keywords:
Focuses: Cc:

Description

Previously:

Continuation of ongoing work to add and/or improve the PHPUnit tests @covers annotations for more accurate coverage reporting.

Change History (3)

#1 @hellofromTonya
14 months ago

In 55565:

Tests: Add test class for wp_script_is().

Changes:

  • Adds a test class for wp_script_is().
  • Moves WP_Dependencies_jQuery::test_wp_script_is_dep_enqueued() into this test class and splits it into 2 separate tests, happy and unhappy paths.
  • Adds WP_Scripts::query @covers, as wp_script_is() is helper function for it.
  • Relocates the global resetting from the test method to the clean_up_global_scope() method.

Follow-up to [52010], [29252].

Props hellofromTonya, antonvlasenko.
See #57841, #57958.

#2 @hellofromTonya
14 months ago

In 55572:

Tests: Rename test class and improve tests for wp_get_global_stylesheet().

Changes include:

  • Renames the test class to be compliant with test coding standards.
  • Converts the test class to extend WP_Theme_UnitTestCase to reuse test fixtures.
  • Implements data providers to encapsulate datasets and reduce code repetition.
  • Adds a @covers annotation.
  • Improves assertion messages to help with diagnosing failed tests.

Follow-up to [55567], [55148], [52682], [53916], [52675-52677].

Props costdev, hellofromTonya.
See #57841, #57958.

#3 @hellofromTonya
10 months ago

  • Resolution set to fixed
  • Status changed from assigned to closed

With 6.3 now in RC cycle, closing this ticket.

#58851 is open for the 6.4 cycle.

Note: See TracTickets for help on using tickets.