Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#60357 closed defect (bug) (fixed)

Add check for fitler to sanitize_textarea_field and sanitize_text_field PHPtests

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

Description


Change History (6)

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


3 years 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:


3 years ago
#2

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

​@SergeyBiryukov commented on ​PR #5954:


3 years 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
3 years ago

  • Milestone Awaiting Review → 6.5

#5 @SergeyBiryukov
3 years ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status new → 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:


3 years ago
#6

Merged with some adjustments in r57368.

Note: See TracTickets for help on using tickets.