Make WordPress Core

Opened 5 weeks ago

Closed 5 weeks ago

#65186 closed enhancement (fixed)

Tests: Add unit tests for _customizer_mobile_viewport_meta()

Reported by: pbearne's profile pbearne Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 7.1 Priority: normal
Severity: normal Version:
Component: Administration Keywords: has-patch has-unit-tests
Focuses: tests Cc:

Description (last modified by pbearne)

This ticket adds unit tests for the _customizer_mobile_viewport_meta() function in wp-admin/includes/misc.php. The tests will verify that the function correctly appends the mobile-specific viewport settings to the existing viewport meta string.

Change History (5)

#1 @pbearne
5 weeks ago

  • Description modified (diff)
  • Summary changed from Tests: Add unit tests for extract_from_markers() to Tests: Add unit tests for _customizer_mobile_viewport_meta()

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


5 weeks ago
#2

  • Keywords has-patch has-unit-tests added

Description:
This PR adds unit tests for the _customizer_mobile_viewport_meta() function in wp-admin/includes/misc.php. These tests ensure that the function correctly appends Customizer-specific viewport settings (minimum-scale=0.5,maximum-scale=1.2) to an existing viewport meta string, while handling trailing commas and empty input.

The tests cover:

  • Appending to a standard viewport string.
  • Handling of empty input strings.
  • Correct trimming of single and multiple trailing commas before appending.

Trac ticket: https://core.trac.wordpress.org/ticket/65186

AI Disclosure:

  • AI assistance: Yes
  • Tool(s): Junie (JetBrains)
  • Model(s): gemini-3-flash-preview
  • Used for: Code analysis, test implementation, and workflow management.

#3 @desrosj
5 weeks ago

  • Focuses tests added

Adding the tests focus, which is used to indicate a ticket is solely focused on adding tests.

#4 @SergeyBiryukov
5 weeks ago

  • Milestone changed from Awaiting Review to 7.1

#5 @SergeyBiryukov
5 weeks ago

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

In 62352:

Tests: Add unit tests for _customizer_mobile_viewport_meta().

Follow-up to [48412].

Props pbearne.
Fixes #65186.

Note: See TracTickets for help on using tickets.