Opened 10 years ago
Closed 10 years ago
#37090 closed enhancement (fixed)
Unit test for wp_get_http_headers
| Reported by: | borgesbruno | Owned by: | rmccue |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.6 |
| Component: | HTTP API | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: |
Description (last modified by )
I've wrote some tests to improve the code coverage, this special one needs to do an external request to get the headers and check whether is a valid or not response header.
This is the second ticket regarded about this duty, the first one is in #37073, following the @rmccue recommendation I've created a new ticket only with the tests
Attachments (2)
Change History (11)
#2
@
10 years ago
- Component General → HTTP API
- Milestone Awaiting Review → 4.6
- Owner set to
- Status new → reviewing
#5
@
10 years ago
@jipmoors That's a known issue due to some changes to the trac database yesterday. You should be able to upload it soon-ish.
#6
@
10 years ago
These acceptance and unit tests can be complementary.
I can understand internals would be changed at some point so unit tests would fail, so I am thinking about writing unit tests to cover the WP_Http class, which is used to supply the actual fetching functionality.
#7
@
10 years ago
This is also a good approach @jipmoors use a mock instead of a real http request, like you said can be complementary
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I have created a new patch which has unit tests instead of acceptance tests.