WordPress.org

Make WordPress Core

Opened 6 months ago

Closed 3 days ago

Last modified 3 days 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:

Description

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 6 months ago.
patch with unit test
46631.2.patch (3.4 KB) - added by pbearne 6 months ago.
fixed typo
46631.3.patch (3.4 KB) - added by pbearne 6 months ago.
another typo

Download all attachments as: .zip

Change History (8)

@pbearne
6 months ago

patch with unit test

@pbearne
6 months ago

fixed typo

@pbearne
6 months ago

another typo

#1 @SergeyBiryukov
5 months ago

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

#2 @desrosj
4 months ago

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

#3 @SergeyBiryukov
3 days 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
3 days 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
3 days ago

In 46108:

Coding Standards: Fix WPCS issue in [46107].

See #46631.

Note: See TracTickets for help on using tickets.