Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#46631 closed defect (bug) (fixed)

Unit test for get_status_header_desc();

Reported by: pbearne's profile pbearne Owned by: desrosj's profile 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 years ago.
patch with unit test
46631.2.patch (3.4 KB) - added by pbearne 6 years ago.
fixed typo
46631.3.patch (3.4 KB) - added by pbearne 6 years ago.
another typo

Download all attachments as: .zip

Change History (8)

@pbearne
6 years ago

patch with unit test

@pbearne
6 years ago

fixed typo

@pbearne
6 years ago

another typo

#1 @SergeyBiryukov
6 years ago

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

#2 @desrosj
6 years ago

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

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

In 46108:

Coding Standards: Fix WPCS issue in [46107].

See #46631.

Note: See TracTickets for help on using tickets.