Make WordPress Core

Opened 5 months ago

Closed 5 months ago

Last modified 5 months ago

#60357 closed defect (bug) (fixed)

Add check for fitler to sanitize_textarea_field and sanitize_text_field PHPtests

Reported by: pbearne's profile pbearne Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.5 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch has-unit-tests
Focuses: Cc:

Description


Change History (6)

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


5 months ago
#1

  • Keywords has-patch has-unit-tests added

The updated PHPUnit test now includes more robust checks on the sanitize text field and sanitize textarea field functions. This change also ensures that the filters for each function are correctly invoked with the addition of the MockAction class and get_call_count tests.

@audrasjb commented on PR #5954:


5 months ago
#2

Thanks for the PR, I added a small WPCS correction.

@SergeyBiryukov commented on PR #5954:


5 months ago
#3

Thanks for the PR! I think it would be better to include these new checks separately. If all we want to check here is that the filters are applied as expected, if seems sufficient to do that once. Including them in the current test seems a bit redundant, since it runs more than 20 times, for each data set in the data provider.

#4 @SergeyBiryukov
5 months ago

  • Milestone changed from Awaiting Review to 6.5

#5 @SergeyBiryukov
5 months ago

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

In 57368:

Tests: Expand sanitize_text_field() tests.

This change ensures that the sanitize_text_field and sanitize_textarea_field filters are correctly invoked for the respective functions.

Follow-up to [38944].

Props pbearne, audrasjb.
Fixes #60357.

@SergeyBiryukov commented on PR #5954:


5 months ago
#6

Merged with some adjustments in r57368.

Note: See TracTickets for help on using tickets.