WordPress.org

Make WordPress Core

Opened 8 months ago

Closed 2 months ago

Last modified 2 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:
PR Number:

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

Download all attachments as: .zip

Change History (8)

@pbearne
8 months ago

patch with unit test

@pbearne
8 months ago

fixed typo

@pbearne
8 months ago

another typo

#1 @SergeyBiryukov
7 months ago

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

#2 @desrosj
6 months ago

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

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

In 46108:

Coding Standards: Fix WPCS issue in [46107].

See #46631.

Note: See TracTickets for help on using tickets.