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.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | drupal.drupalLogin.patch | 1.7 KB | sun |
| #4 | drupal.drupalLogin.patch | 1.4 KB | sun |
| drupal.drupalLogin.patch | 1.08 KB | sun |
Comments
Comment #2
dries commentedPatch needs more code comments. Thanks!
Comment #3
damien tournoud commentedI 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?
| Status | File | Size |
|---|---|---|
| new | drupal.drupalLogin.patch | 1.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.
Comment #5
damien tournoud commentedGreat.
Comment #6
drewish commentedhumm this issue kind of affects #287292: Add functionality to impersonate a user
Comment #7
drewish commentedhumm this issue kind of affects #287292: Add functionality to impersonate a user
Comment #8
dries commentedThe example is a bit confusing. What exactly are we doing with raw_pass here and why? Could use better documentation, or a better example.
| Status | File | Size |
|---|---|---|
| new | drupal.drupalLogin.patch | 1.7 KB |
Added a use-case for re-assigning the raw user password.
Comment #11
dries commentedCommitted to CVS HEAD. Thanks.
Automatically closed -- issue fixed for two weeks with no activity.
Comment #1
dave reidDo 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.