Index: modules/blog/blog.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/blog/blog.test,v
retrieving revision 1.9
diff -u -p -r1.9 blog.test
--- modules/blog/blog.test	3 Apr 2009 20:24:57 -0000	1.9
+++ modules/blog/blog.test	21 Apr 2009 22:55:11 -0000
@@ -66,7 +66,7 @@ class BlogTestCase extends DrupalWebTest
     // Login the user.
     $this->drupalLogin($user);
     // Create blog node.
-    $node = $this->drupalCreateNode(array('type' => 'blog', 'uid' => $user->uid));
+    $node = $this->drupalCreateNode(array('type' => 'blog'));
     // Verify the user has access to all the blog nodes.
     $this->verifyBlogs($user, $node, $admin);
     // Verify the blog links are displayed.
Index: modules/menu/menu.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/menu/menu.test,v
retrieving revision 1.9
diff -u -p -r1.9 menu.test
--- modules/menu/menu.test	31 Mar 2009 01:49:52 -0000	1.9
+++ modules/menu/menu.test	21 Apr 2009 22:55:14 -0000
@@ -136,8 +136,8 @@ class MenuTestCase extends DrupalWebTest
    */
   function doMenuTests($menu_name = 'navigation') {
     // Add nodes to use as links for menu links.
-    $node1 = $this->drupalCreateNode(array('type' => 'article', 'uid' => $this->big_user->uid));
-    $node2 = $this->drupalCreateNode(array('type' => 'article', 'uid' => $this->big_user->uid));
+    $node1 = $this->drupalCreateNode(array('type' => 'article'));
+    $node2 = $this->drupalCreateNode(array('type' => 'article'));
 
     // Add menu links.
     $item1 = $this->addMenuLink(0, 'node/' . $node1->nid, $menu_name);
Index: modules/path/path.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/path/path.test,v
retrieving revision 1.8
diff -u -p -r1.8 path.test
--- modules/path/path.test	31 Mar 2009 02:02:22 -0000	1.8
+++ modules/path/path.test	21 Apr 2009 22:55:14 -0000
@@ -15,8 +15,9 @@ class PathTestCase extends DrupalWebTest
    */
   function setUp() {
     parent::setUp('path');
-    // create and login user
-    $web_user = $this->drupalCreateUser(array('edit any page content', 'create page content', 'administer url aliases', 'create url aliases'));
+
+    // Create test user and login.
+    $web_user = $this->drupalCreateUser(array('create page content', 'edit own page content', 'administer url aliases', 'create url aliases'));
     $this->drupalLogin($web_user);
   }
 
@@ -24,7 +25,7 @@ class PathTestCase extends DrupalWebTest
    * Test alias functionality through the admin interfaces.
    */
   function testAdminAlias() {
-    // create test node
+    // Create test node.
     $node1 = $this->drupalCreateNode();
 
     // Create alias.
Index: modules/php/php.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/php/php.test,v
retrieving revision 1.8
diff -u -p -r1.8 php.test
--- modules/php/php.test	31 Mar 2009 01:49:53 -0000	1.8
+++ modules/php/php.test	21 Apr 2009 22:55:14 -0000
@@ -24,7 +24,7 @@ class PHPTestCase extends DrupalWebTestC
    * @return stdObject Node object.
    */
   function createNodeWithCode($user) {
-    $node = $this->drupalCreateNode(array('uid' => $user->uid));
+    $node = $this->drupalCreateNode();
     $edit = array();
     $edit['body'] = '<?php print "SimpleTest PHP was executed!"; ?>';
     $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
@@ -59,7 +59,7 @@ class PHPFilterTestCase extends PHPTestC
     $web_user = $this->drupalCreateUser(array('access content', 'create page content', 'edit own page content'));
     $this->drupalLogin($web_user);
 
-    $node = $this->createNodeWithCode($web_user);
+    $node = $this->createNodeWithCode();
 
     // Make sure that the PHP code shows up as text.
     $this->assertText('print', t('PHP code is displayed.'));
@@ -96,7 +96,7 @@ class PHPAccessTestCase extends PHPTestC
     $web_user = $this->drupalCreateUser(array('access content', 'create page content', 'edit own page content'));
     $this->drupalLogin($web_user);
 
-    $node = $this->createNodeWithCode($web_user);
+    $node = $this->createNodeWithCode();
 
     // Make sure that the PHP code shows up as text.
     $this->assertText('print', t('PHP code is displayed.'));
Index: modules/simpletest/drupal_web_test_case.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v
retrieving revision 1.95
diff -u -p -r1.95 drupal_web_test_case.php
--- modules/simpletest/drupal_web_test_case.php	20 Apr 2009 20:02:31 -0000	1.95
+++ modules/simpletest/drupal_web_test_case.php	21 Apr 2009 22:55:18 -0000
@@ -56,11 +56,11 @@ class DrupalWebTestCase {
   protected $elements = NULL;
 
   /**
-   * Whether a user is logged in the internal browser.
+   * The current user logged in using the internal browser.
    *
    * @var bool
    */
-  protected $isLoggedIn = FALSE;
+  protected $loggedInUser = FALSE;
 
   /**
    * The current cookie file used by cURL.
@@ -486,7 +486,7 @@ class DrupalWebTestCase {
    */
   protected function drupalCreateNode($settings = array()) {
     // Populate defaults array
-    $defaults = array(
+    $settings += array(
       'body'      => $this->randomName(32),
       'title'     => $this->randomName(8),
       'comment'   => 2,
@@ -502,18 +502,22 @@ class DrupalWebTestCase {
       'revisions' => NULL,
       'taxonomy'  => NULL,
     );
-    $defaults['teaser'] = $defaults['body'];
-    // If we already have a node, we use the original node's created time, and this
-    if (isset($defaults['created'])) {
-      $defaults['date'] = format_date($defaults['created'], 'custom', 'Y-m-d H:i:s O');
-    }
-    if (empty($settings['uid'])) {
-      global $user;
-      $defaults['uid'] = $user->uid;
+    if (!isset($settings['teaser'])) {
+      $settings['teaser'] = $settings['body'];      
+    }
+    // If the uid is not set manually, we assign the uid of the logged in user,
+    // if available, or else the uid of the user running the test.
+    if (!isset($settings['uid'])) {
+      if ($this->loggedInUser) {
+        $settings['uid'] = $this->loggedInUser->uid;
+      }
+      else {
+        global $user;
+        $settings['uid'] = $user->uid;
+      }
     }
-    $node = ($settings + $defaults);
-    $node = (object)$node;
 
+    $node = (object) $settings;
     node_save($node);
 
     // small hack to link revisions to our test user
@@ -768,7 +772,7 @@ class DrupalWebTestCase {
    * @see drupalCreateUser()
    */
   protected function drupalLogin(stdClass $user) {
-    if ($this->isLoggedIn) {
+    if ($this->loggedInUser) {
       $this->drupalLogout();
     }
 
@@ -782,7 +786,9 @@ class DrupalWebTestCase {
     $pass = $pass && $this->assertNoText(t('The username %name has been blocked.', array('%name' => $user->name)), t('No blocked message at login page'), t('User login'));
     $pass = $pass && $this->assertNoText(t('The name %name is a reserved username.', array('%name' => $user->name)), t('No reserved message at login page'), t('User login'));
 
-    $this->isLoggedIn = $pass;
+    if ($pass) {
+      $this->loggedInUser = $user;
+    }
   }
 
   /*
@@ -797,7 +803,9 @@ class DrupalWebTestCase {
     $pass = $this->assertField('name', t('Username field found.'), t('Logout'));
     $pass = $pass && $this->assertField('pass', t('Password field found.'), t('Logout'));
 
-    $this->isLoggedIn = !$pass;
+    if ($pass) {
+      $this->loggedInUser = FALSE;
+    }
   }
 
   /**
@@ -921,7 +929,7 @@ class DrupalWebTestCase {
       drupal_save_session(TRUE);
 
       // Ensure that internal logged in variable and cURL options are reset.
-      $this->isLoggedIn = FALSE;
+      $this->loggedInUser = FALSE;
       $this->additionalCurlOptions = array();
 
       // Reload module list and implementations to ensure that test module hooks
Index: modules/tracker/tracker.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/tracker/tracker.test,v
retrieving revision 1.7
diff -u -p -r1.7 tracker.test
--- modules/tracker/tracker.test	31 Mar 2009 01:49:54 -0000	1.7
+++ modules/tracker/tracker.test	21 Apr 2009 22:55:18 -0000
@@ -17,7 +17,7 @@ class TrackerTest extends DrupalWebTestC
   function setUp() {
     parent::setUp('comment', 'tracker');
 
-    $permissions = array('access comments', 'post comments', 'post comments without approval');
+    $permissions = array('access comments', 'create page content', 'post comments', 'post comments without approval');
     $this->user = $this->drupalCreateUser($permissions);
     $this->other_user = $this->drupalCreateUser($permissions);
   }
Index: modules/upload/upload.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload/upload.test,v
retrieving revision 1.15
diff -u -p -r1.15 upload.test
--- modules/upload/upload.test	20 Apr 2009 20:02:31 -0000	1.15
+++ modules/upload/upload.test	21 Apr 2009 22:55:18 -0000
@@ -20,7 +20,7 @@ class UploadTestCase extends DrupalWebTe
   function testNodeUpload() {
     global $base_url;
     $admin_user = $this->drupalCreateUser(array('administer site configuration'));
-    $web_user = $this->drupalCreateUser(array('access content', 'edit any page content', 'upload files', 'view uploaded files'));
+    $web_user = $this->drupalCreateUser(array('access content', 'edit own page content', 'upload files', 'view uploaded files'));
 
     $this->drupalLogin($admin_user);
 
@@ -88,7 +88,7 @@ class UploadTestCase extends DrupalWebTe
    */
   function testFilesFilter() {
     $admin_user = $this->drupalCreateUser(array('administer site configuration'));
-    $web_user = $this->drupalCreateUser(array('access content', 'edit any page content', 'upload files', 'view uploaded files'));
+    $web_user = $this->drupalCreateUser(array('access content', 'edit own page content', 'upload files', 'view uploaded files'));
 
     $this->drupalLogin($admin_user);
 
@@ -131,7 +131,7 @@ class UploadTestCase extends DrupalWebTe
     $file = current($files)->filepath;
 
     $admin_user = $this->drupalCreateUser(array('administer site configuration'));
-    $web_user = $this->drupalCreateUser(array('access content', 'edit any page content', 'upload files', 'view uploaded files'));
+    $web_user = $this->drupalCreateUser(array('access content', 'edit own page content', 'upload files', 'view uploaded files'));
 
     $this->drupalLogin($admin_user);
 
