I spent hours of debugging why my tests for #8: Let users cancel their accounts are failing. I assumed my tests were just plain wrong, but the real cause is that

$this->drupalLogin($user);

does not update the passed in $user object, which means that none of the user account properties $user->login, $user->access, etc. is properly set after logging in.

As this patch prevents tests for #8 from passing, marking as critical.

Comments

dave reid’s picture

Do we have a need to re-use this feature? If so, then I'm for it, but this code is executed a lot so it needs to be considered. It seems like it would be easy to do this outside of drupalLogin() and in the test code and leave drupalLogin() simplified.

dries’s picture

Status: Needs review » Needs work

Patch needs more code comments. Thanks!

damien tournoud’s picture

I don't see the point of this neither. drupalLogin() is not supposed to update the passed $user. If you need the full-featured $user, why not calling user_load() yourself?

sun’s picture

Status: Needs work » Needs review
StatusFileSize
new1.4 KB

Meh. Then let's at least add this caveat to the PHPDoc, so others don't need to waste hours of debugging why their tests don't work as expected.

damien tournoud’s picture

Status: Needs review » Reviewed & tested by the community

Great.

drewish’s picture

humm this issue kind of affects #287292: Add functionality to impersonate a user

drewish’s picture

humm this issue kind of affects #287292: Add functionality to impersonate a user

dries’s picture

The example is a bit confusing. What exactly are we doing with raw_pass here and why? Could use better documentation, or a better example.

dries’s picture

Status: Reviewed & tested by the community » Needs work
sun’s picture

Priority: Critical » Normal
Status: Needs work » Needs review
StatusFileSize
new1.7 KB

Added a use-case for re-assigning the raw user password.

dries’s picture

Status: Needs review » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.