Problem/Motivation
I should be able to write a test that fails without crashing.
There are a number of SimpleTest assertions that crash rather than fail.
One of them is drupalLogin().
Typically, you do something like this:
$account = $this->drupalCreateUser(array('my special permission'));
$this->drupalLogin($account);
I should be able to write that test, run it, and have it fail without a code error, even before I implement hook_permission().
drupalCreateUser() does the right thing by returning FALSE if my permission doesn't exist.
drupalLogin() does the WRONG thing by using type hinting instead of checking its input. drupalLogin() should give me a fail if I don't have a valid user, rather than a code error.
Proposed resolution
Remove type hinting from drupalLogin(), and have it show a fail if the account object is invalid. Also, short-circuit the remaining login process.