How to create a user with custom profile fields for a SimpleTest How can I programmatically create a new user for use during a SimpleTest?  The user must have certain custom fields populated during the registration.

I'm using $this-&gt;drupalPost('user/register', $edit, 'Create new account'); to create the account currently as I do not see a way to populate custom profile fields with drupalCreateUser().  

$edit = array(
      'name' =&gt; $this-&gt;randomName(17),
      'mail' =&gt; $this-&gt;randomName(17) . '@example.com',
      'field_owner_first_name[und][0][value]' =&gt; $this-&gt;randomName(17),
      'field_owner_last_name[und][0][value]' =&gt; $this-&gt;randomName(17),
      'field_owner_title[und][0][value]' =&gt; $this-&gt;randomName(8),
      'field_business_name[und][0][value]' =&gt; $this-&gt;randomName(17),
      'field_business_phone[und][0][value]' =&gt; mt_rand(200, 999) . '-' . mt_rand(200, 999) . '-' . mt_rand(1000, 9999),
      'field_business_email[und][0][value]' =&gt; $this-&gt;randomName(17) . '@example.com',
      'field_business_website[und][0][value]' =&gt; 'http://' . $this-&gt;randomName(17) . '.com',
      'field_business_address_1[und][0][value]' =&gt; mt_rand(1, 9999) . ' ' . $this-&gt;randomName(12) . ' ' . $this-&gt;randomName(2),
      'field_business_address_2[und][0][value]' =&gt; 'Apt ' . mt_rand(1, 999),
      'field_city[und][0][value]' =&gt; $this-&gt;randomName(8),
      'field_state[und]' =&gt; 'HI',
      'field_zip[und][0][value]' =&gt; mt_rand(10000, 99999),
      'field_request_website[und]' =&gt; 'Yes',
);
$this-&gt;drupalPost('user/register', $edit, 'Create new account');


The code above successfully completes and posts the registration form.

How can I automatically approve and login as this newly submitted user for testing?  Do I need to write tests to login the admin account, find and then approve the user?



Additional Thoughts and Clarification:

Looking at other options, can I somehow use variable_set() to accomplish the automated user approval above when the setUp() method is called?
in the setUp() method I simply added: variable_set('user_register', 1);

This way I could drupalPost a new account and login immediately without approval.

$this-&gt;drupalPost('user/register', $edit, 'Create new account');

Account is successfully registered and the required additional fields were collected during registration.