How do I block a user/cancel a user account in Simpletest? 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?
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' =&gt; 0));