Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
simpletest.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
24 Apr 2012 at 20:09 UTC
Updated:
29 Jul 2014 at 20:39 UTC
Jump to comment: Most recent file
Comments
Comment #2
c960657 commentedTwo test classes needed some adjustments. I think they are reasonable adjustments (the two in menu.test were bug fixes IMO).
Comment #3
sunExcellent findings + patch!
s/in/out/
Comment #4
c960657 commentedDirection changed :-)
Comment #5
sunAwesome patch. Thanks a lot, @c960657!
Comment #6
dries commentedLooks good. Committed to 8.x. Thanks.
Comment #7
sunThis can actually be backported. It's a (very) small, but still, a test performance improvement.
Comment #8
tim.plunkettThis did not get pushed yet, setting back.
Comment #9
tim.plunketthttp://drupalcode.org/project/drupal.git/commit/9dd0e7b
Comment #10
tim.plunkettNot sure if I'm misunderstanding this, because I don't know how this test is passing.
The code in this patch directly follows this hunk:
Comment #11
tim.plunkettDuh. I clearly did not read how drupalLogin worked. Reroll for D7.
Comment #13
tim.plunkettThere were some oddities in AccessDeniedTestCase that were cleaned up in #1373142: Use the Testing profile. Speed up testbot by 50%.
A chunk of the same code, including drupalLogout(), was called twice in a row.
Comment #15
tim.plunkettIt seems that testUserActionAssignmentExecution is logging in as a user, blocking the user it's logged in as, unblocking it while still theoretically logged in as the blocked user, creating a new user with the same variable name as the newly unblocked user, and trying to log in as that new user.
So I'm a little unsure how to resolve that.
Comment #16
c960657 commentedYou can reset $this->loggedInUser explicitly before calling drupalLogin() again. I did something similar in D8 patch.
Comment #17
tim.plunkettWell this feels like cheating, but okay.
Comment #18
sunWorks for me. Trigger is a dead end either way. ;)
Comment #19
David_Rothstein commentedIf this change broke several core tests, then how is it safe for D7 backport? Won't it break contrib tests too?
Comment #20
sunYou're right. The assertResponse() cannot be backported, only the combination into a single drupalGet() can.
Let's make sure to have a patch that only contains that change, so we can see whether anything breaks with that only.
Comment #21
tim.plunkettFair point.
Comment #22
sunThis needs to pass or this cannot be backported.
Comment #24
sunAlrighty.
Comment #26
Umayal commentedhow to test user logout?
I am using following code to test the logout function.
how to get $this value or user value.
$this->drupalGet('user/logout', array('query' => array('destination' => 'user')));
$this->assertResponse(200, t('User was logged out.'));
I am new for testing.I don't how to test in drupal.
Comment #27
sunThis issue is closed for a long time already, and is not a support ticket. See http://drupal.org/simpletest for the testing handbook.
Restoring issue title.