I'm trying to write some tests for a module for situations in which a user is blocked. I know I can use drupalCreateUser()
to make new users, but how do I block a user I have created in Simpletest?
1 Answer
Once you've got the user object back from drupalCreateUser()
you can use standard API methods to make changes (in this case user_save()
):
user_save($user, array('status' => 0));