? 522900_simpletests_for_talk.patch
? 558540_1_pluggable_comment_rendering.patch
Index: talk.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/talk/Attic/talk.test,v
retrieving revision 1.1.2.2
diff -u -p -r1.1.2.2 talk.test
--- talk.test	19 Aug 2009 01:43:31 -0000	1.1.2.2
+++ talk.test	1 Sep 2009 19:21:11 -0000
@@ -15,7 +15,7 @@ class TalkTests extends DrupalWebTestCas
 
   function setUp() {
     // Enable the talk module and its dependencies.
-    parent::setUp('comment', 'talk');
+    parent::setUp('comment', 'talk', 'token');
 
     // Create a node type, and enable the talk module for that node type.
     $node_type = $this->drupalCreateContentType();
@@ -28,9 +28,15 @@ class TalkTests extends DrupalWebTestCas
     variable_set('comment_preview_'. $node_type->type, COMMENT_PREVIEW_OPTIONAL);
 
     // Set the talk title to something unique.
-    $this->talkTitle = $this->randomName();
+    $this->talkTitle = $this->randomName() .' [node_comment_count]';
     variable_set('talk_page', $this->talkTitle);
 
+    $this->talkLink = $this->randomName() .' [unread_comment_count]';
+    variable_set('talk_link', $this->talkLink);
+
+    $this->talkTab = $this->randomName() .' [unread_comment_count]';
+    variable_set('talk_tab', $this->talkTab);
+
     // Create and login a user with the appropriate permissions.
     $permissions = array('access content', 'access comments', 'post comments', 'post comments without approval');
     $user = $this->drupalCreateUser($permissions);
@@ -47,6 +53,14 @@ class TalkTests extends DrupalWebTestCas
     $settings['type'] = $this->talkType;
     $node = $this->drupalCreateNode($settings);
 
+    // Get a friendly talk "add new comment" page.
+    $this->drupalGet('node/'. $node->nid .'/talk');
+    $this->assertText(t('Add new comment'), t('Make sure that the talk page invites them to make a comment by default.'));
+    // Turn off the message and get an access denied on the page.
+    variable_set('talk_page_no_comments', FALSE);
+    $this->drupalGet('node/'. $node->nid .'/talk');
+    $this->assertText(t('Access denied'), t('Make sure that the talk page gives an Access denied if configured that way.'));
+
     // Navigate to the node page.
     $this->drupalGet('node/'. $node->nid);
 
@@ -64,6 +78,13 @@ class TalkTests extends DrupalWebTestCas
     // Make the actual assertions here.
     $this->assertText($subject, t('Make sure that the subject of the comment appears'));
     $this->assertText($comment, t('Make sure the body of the comment appears'));
-    $this->assertText($this->talkTitle, t('Make sure the talk title appears @title', array('@title' => str_replace('!count', 1, $this->talkTitle))));
+    $this->assertText(str_replace('[node_comment_count]', 1, $this->talkTitle), t('Make sure the talk title appears @title', array('@title' => str_replace('[node_comment_count]', 1, $this->talkTitle))));
+
+    // Confirm that the link and tab are as they should be.
+    $this->drupalGet('node/'. $node->nid);
+    $this->assertText(str_replace('[unread_comment_count]', 0, $this->talkLink), t('Make sure the talk link appears @title', array('@title' => str_replace('[unread_comment_count]', 0, $this->talkLink))));
+
+    $this->assertText(str_replace('[unread_comment_count]', 0, $this->talkTab), t('Make sure the talk tab appears @title', array('@title' => str_replace('[unread_comment_count]', 0, $this->talkTab))));
+
   }
 }
\ No newline at end of file
