#35196 closed task (blessed) (wontfix)
Unit tests for URL schemes
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | General | Keywords: | https has-patch bulk-reopened |
| Focuses: | Cc: |
Description
In order to tackle various HTTPS related issues, it would be ideal to have test coverage for the schemes of URLs returned by the URL-generating functions under various conditions.
For example, we know that admin_url() should always return a URL with an https scheme when FORCE_SSL_ADMIN is true. However the scheme in the URL returned by home_url() varies depending on the current request's scheme as well as the home option's scheme.
We can test all combinations of schemes in the home and siteurl options, as well as the force_ssl_admin() setting, and test the schemes of URLs returned by various functions under various situations (admin vs. front end, and is_ssl() vs. not).
Patch coming up soon.
35196.diff is where I'm going with this.
data_scheme_matrix()defines a matrix of information about which functions should return a URL with anhttpsscheme under which circumstances. It's incomplete, and there are many failures, particularly due to the fact thatwp_upload_dir()is not testable due to its use of theWP_CONTENT_URLconstant.