Make WordPress Core

Opened 7 years ago

Last modified 10 months ago

#36476 new enhancement

Add tests for sign on related functions

Reported by: slimndap's profile slimndap Owned by:
Milestone: Future Release 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 (1)

36476.1.diff (4.7 KB) - added by johnregan3 10 months ago.
Test for wp_authenticate functions

Download all attachments as: .zip

Change History (3)

#1 @desrosj
11 months 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

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).

@johnregan3
10 months ago

Test for wp_authenticate functions

#2 @johnregan3
10 months ago

  • Keywords has-patch added

Added tests for wp_authenticate_username_password(), wp_authenticate_email_password(), and wp_authenticate_cookie().

Note: See TracTickets for help on using tickets.