Index: modules/user/user.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.test,v
retrieving revision 1.36
diff -u -p -r1.36 user.test
--- modules/user/user.test	13 May 2009 17:23:48 -0000	1.36
+++ modules/user/user.test	17 May 2009 05:00:18 -0000
@@ -1040,3 +1040,36 @@ class UserSaveTestCase extends DrupalWeb
     $this->assertTrue($user_by_name, t('Loading user by name.'));
   }
 }
+
+/**
+ * Link to a node author's profile should lead to the author's profile page.
+ */
+class UserProfileLinksFunctionalTest extends DrupalWebTestCase {
+  function getInfo() {
+    return array(
+      'name' => t('User profile links'),
+      'description' => t("Link to a node author's profile should lead to the author's profile page."),
+      'group' => t('User')
+    );
+  }
+
+  function testUserProfileLink() {
+    $user_a = $this->drupalCreateUser(array('create article content'));
+    $user_b = $this->drupalCreateUser(array('access content', 'access user profiles'));
+
+    // User A creates a node.
+    $this->drupalLogin($user_a);
+    $edit = array();
+    $edit['title'] = $this->randomName(8);
+    $edit['body'] = $this->randomName(16);
+    $this->drupalPost('node/add/article', $edit, t('Save'));
+    $node = $this->drupalGetNodeByTitle($edit['title']);
+  
+    // User B views the node
+    $this->drupalLogin($user_b);
+    $this->drupalGet("node/$node->nid");
+    $this->assertRaw(t("View user profile."), t('User profile link found.'));
+    $this->assertNotEqual(theme('username', $user_a), theme('username', $user_b), t('Theme username works.'));
+    $this->assertRaw(theme('username', $user_a), t("Author's UID found."));
+  }
+}
