Opened 9 years ago
Closed 9 years ago
#37308 closed defect (bug) (fixed)
`wp_insert_user()` test failing due to database autoincrement
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 4.6 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Users | Keywords: | |
Focuses: | Cc: |
Description
For about a week (since [37905] for me, though it's largely inconsequential), Tests_User::test_wp_insert_user_with_invalid_user_id()
has been failing for me. The reason is that the ID 123
is hardcoded there, but there is an existing user in the installation with the ID 123
. There are two problems:
- If the point of
test_wp_insert_user_with_invalid_user_id()
is to test a truly invalid ID, it should check for the ID's invalidity first. This is an easy fix. - By the time the suite gets to
test_wp_insert_user_with_invalid_user_id()
(after about 5900 tests), there are 6 users in thewp_users
table. This means that some tests are not cleaning up their mess.
I'll see if I can track it down.
Change History (3)
Note: See
TracTickets for help on using
tickets.
I was wrong about the leakage - the users are created in
setUpBeforeClass()
. It just so happens that one of them has the ID 123, because of the database autoincrement. Fixing the first bullet point should be enough.