Make WordPress Core

Opened 11 months ago

Closed 5 months ago

Last modified 5 months ago

#46631 closed defect (bug) (fixed)

Unit test for get_status_header_desc();

Reported by: pbearne Owned by: desrosj
Milestone: 5.3 Priority: normal
Severity: normal Version:
Component: HTTP API Keywords: has-patch has-unit-tests dev-feedback
Focuses: Cc:


Just the missing unit test for get_status_header_desc() from the function.php file

Attachments (3)

46631.patch (3.4 KB) - added by pbearne 11 months ago.
patch with unit test
46631.2.patch (3.4 KB) - added by pbearne 11 months ago.
fixed typo
46631.3.patch (3.4 KB) - added by pbearne 11 months ago.
another typo

Download all attachments as: .zip

Change History (8)

11 months ago

patch with unit test

11 months ago

fixed typo

11 months ago

another typo

#1 @SergeyBiryukov
10 months ago

  • Milestone changed from Awaiting Review to 5.3
  • Version trunk deleted

#2 @desrosj
9 months ago

  • Owner set to desrosj
  • Status changed from new to reviewing

#3 @SergeyBiryukov
5 months ago

Thanks for the patch!

Since the function is just an array of labels without any complex logic, I don't see a point in duplicating the entire array in the test.

I think we could just make sure the function returns an empty string if $code is not found, or a non-empty string otherwise, as stated in the documentation.

#4 @SergeyBiryukov
5 months ago

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

In 46107:

HTTP API: Add a unit test for get_status_header_desc().

Props pbearne.
Fixes #46631.

#5 @SergeyBiryukov
5 months ago

In 46108:

Coding Standards: Fix WPCS issue in [46107].

See #46631.

Note: See TracTickets for help on using tickets.