Opened 9 years ago
Closed 15 months ago
#36476 closed enhancement (fixed)
Add tests for sign on related functions
Reported by: | slimndap | Owned by: | jorbin |
---|---|---|---|
Milestone: | 6.4 | Priority: | normal |
Severity: | normal | Version: | 2.5 |
Component: | Login and Registration | Keywords: | good-first-bug needs-unit-tests has-patch |
Focuses: | administration | Cc: |
Description
I don't think that the login procedure and the underlying wp_signon()
are covered by (php)unit tests.
Since this is something quite trivial, I believe this should be added.
I tried to add it myself, but failed. Keep running into Cannot modify header information - headers already sent
errors.
Attachments (2)
Change History (7)
#1
@
2 years ago
- Keywords good-first-bug needs-unit-tests added
- Milestone set to Future Release
- Summary changed from The login form is not covered by a test to Add tests for sign on related functions
- Version changed from 4.4.2 to 2.5
#2
@
2 years ago
- Keywords has-patch added
Added tests for wp_authenticate_username_password()
, wp_authenticate_email_password()
, and wp_authenticate_cookie()
.
@
15 months ago
Unsets the AUTH_COOKIE and SECURE_AUTH_COOKIE so test_wp_authenticate_cookie_with_invalid_cookie() doesn't cause Tests_Auth::test_wp_signon_does_not_throw_deprecation_notices_with_default_parameters to fail
#3
@
15 months ago
@johnregan3 the new Tests_Auth::test_wp_authenticate_cookie_with_invalid_cookie()
appeared to be throwing off the existing Tests_Auth::test_wp_signon_does_not_throw_deprecation_notices_with_default_parameters
test because the $_COOKIE
values were carrying over. The test was succeeding by itself but failing when run with the other tests in Tests_Auth
.
36476.2.diff is addressing the issue in my tests.
Hi @slimndap,
Welcome to Trac! My apologies this took so long to receive a response.
It's been a while so I took a look. Seems there is one test for
wp_signon()
now that was added while solving #38744, but this area could definitely benefit from more unit tests (wp_authenticate_username_password(),
wp_authenticate_email_password(), and
wp_authenticate_cookie()` also do not have any tests).