Make WordPress Core

Opened 8 months ago

Closed 8 months ago

Last modified 8 months ago

#56835 closed enhancement (fixed)

Increase test coverage to WP_Theme_JSON_Resolver

Reported by: cbravobernal's profile cbravobernal Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.1 Priority: normal
Severity: normal Version: 6.1
Component: Themes Keywords: has-patch has-unit-tests
Focuses: Cc:

Description (last modified by SergeyBiryukov)

Adding a test to cover WP_Theme_JSON_Resolver->get_theme_data()

We only test the add_theme_support overriding feature and that the functions return a WP_Theme_JSON object, as the part of the code that merges the child theme into the parent theme has been already tested in test_merges_child_theme_json_into_parent_theme_json on tickets #56611, #54336.

Change History (6)

This ticket was mentioned in PR #3475 on WordPress/wordpress-develop by @cbravobernal.

8 months ago

  • Keywords has-patch has-unit-tests added

#2 @SergeyBiryukov
8 months ago

  • Description modified (diff)
  • Milestone changed from Awaiting Review to 6.1

#3 @SergeyBiryukov
8 months ago

  • Component changed from General to Themes

#4 @SergeyBiryukov
8 months ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 54630:

Tests: Increase test coverage for WP_Theme_JSON_Resolver.

This commit adds a unit test to check that WP_Theme_JSON_Resolver::get_theme_data() returns a WP_Theme_JSON object, and that an add_theme_support() call overrides the settings from theme.json.

Follow-up to [54443], [54493].

Props cbravobernal.
Fixes #56835.

@SergeyBiryukov commented on PR #3475:

8 months ago

Thanks for the PR! Merged in r54630.

#6 @SergeyBiryukov
8 months ago

In 54631:

Tests: Correct the wp_theme_json_data_default filter name in assertion messages.

The theme_json_default filter was previously renamed to wp_theme_json_data_default.

This commit updates the messages in WP_Theme_JSON_Resolver tests to match the new name.

Follow-up to [54501], [54630].

See #56796, #56835.

Note: See TracTickets for help on using tickets.