1

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?

0

1 Answer 1

1

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));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.