diff --git a/modules/comment/comment.test b/modules/comment/comment.test index f4e57c110..cc4687dc0 100644 --- a/modules/comment/comment.test +++ b/modules/comment/comment.test @@ -251,56 +251,6 @@ class CommentHelperCase extends DrupalWebTestCase { return $match[2]; } - - /** - * Tests new comment marker. - */ - public function testCommentNewCommentsIndicator() { - // Test if the right links are displayed when no comment is present for the - // node. - $this->drupalLogin($this->admin_user); - $this->node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1, 'comment' => COMMENT_NODE_OPEN)); - $this->drupalGet('node'); - $this->assertNoLink(t('@count comments', array('@count' => 0))); - $this->assertNoLink(t('@count new comments', array('@count' => 0))); - $this->assertLink(t('Read more')); - $count = $this->xpath('//div[@id=:id]/div[@class=:class]/ul/li', array(':id' => 'node-' . $this->node->nid, ':class' => 'link-wrapper')); - $this->assertTrue(count($count) == 1, t('One child found')); - - // Create a new comment. This helper function may be run with different - // comment settings so use comment_save() to avoid complex setup. - $comment = (object) array( - 'cid' => NULL, - 'nid' => $this->node->nid, - 'node_type' => $this->node->type, - 'pid' => 0, - 'uid' => $this->loggedInUser->uid, - 'status' => COMMENT_PUBLISHED, - 'subject' => $this->randomName(), - 'hostname' => ip_address(), - 'language' => LANGUAGE_NONE, - 'comment_body' => array(LANGUAGE_NONE => array($this->randomName())), - ); - comment_save($comment); - $this->drupalLogout(); - - // Log in with 'web user' and check comment links. - $this->drupalLogin($this->web_user); - $this->drupalGet('node'); - $this->assertLink(t('1 new comment')); - $this->clickLink(t('1 new comment')); - $this->assertRaw('', t('Found "new" marker.')); - $this->assertTrue($this->xpath('//a[@id=:new]/following-sibling::a[1][@id=:comment_id]', array(':new' => 'new', ':comment_id' => 'comment-1')), t('The "new" anchor is positioned at the right comment.')); - - // Test if "new comment" link is correctly removed. - $this->drupalGet('node'); - $this->assertLink(t('1 comment')); - $this->assertLink(t('Read more')); - $this->assertNoLink(t('1 new comment')); - $this->assertNoLink(t('@count new comments', array('@count' => 0))); - $count = $this->xpath('//div[@id=:id]/div[@class=:class]/ul/li', array(':id' => 'node-' . $this->node->nid, ':class' => 'link-wrapper')); - $this->assertTrue(count($count) == 2, print_r($count, TRUE)); - } } class CommentInterfaceTest extends CommentHelperCase { @@ -472,6 +422,56 @@ class CommentInterfaceTest extends CommentHelperCase { $this->setCommentForm(FALSE); } + /** + * Tests new comment marker. + */ + public function testCommentNewCommentsIndicator() { + // Test if the right links are displayed when no comment is present for the + // node. + $this->drupalLogin($this->admin_user); + $this->node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1, 'comment' => COMMENT_NODE_OPEN)); + $this->drupalGet('node'); + $this->assertNoLink(t('@count comments', array('@count' => 0))); + $this->assertNoLink(t('@count new comments', array('@count' => 0))); + $this->assertLink(t('Read more')); + $count = $this->xpath('//div[@id=:id]/div[@class=:class]/ul/li', array(':id' => 'node-' . $this->node->nid, ':class' => 'link-wrapper')); + $this->assertTrue(count($count) == 1, t('One child found')); + + // Create a new comment. This helper function may be run with different + // comment settings so use comment_save() to avoid complex setup. + $comment = (object) array( + 'cid' => NULL, + 'nid' => $this->node->nid, + 'node_type' => $this->node->type, + 'pid' => 0, + 'uid' => $this->loggedInUser->uid, + 'status' => COMMENT_PUBLISHED, + 'subject' => $this->randomName(), + 'hostname' => ip_address(), + 'language' => LANGUAGE_NONE, + 'comment_body' => array(LANGUAGE_NONE => array($this->randomName())), + ); + comment_save($comment); + $this->drupalLogout(); + + // Log in with 'web user' and check comment links. + $this->drupalLogin($this->web_user); + $this->drupalGet('node'); + $this->assertLink(t('1 new comment')); + $this->clickLink(t('1 new comment')); + $this->assertRaw('', t('Found "new" marker.')); + $this->assertTrue($this->xpath('//a[@id=:new]/following-sibling::a[1][@id=:comment_id]', array(':new' => 'new', ':comment_id' => 'comment-1')), t('The "new" anchor is positioned at the right comment.')); + + // Test if "new comment" link is correctly removed. + $this->drupalGet('node'); + $this->assertLink(t('1 comment')); + $this->assertLink(t('Read more')); + $this->assertNoLink(t('1 new comment')); + $this->assertNoLink(t('@count new comments', array('@count' => 0))); + $count = $this->xpath('//div[@id=:id]/div[@class=:class]/ul/li', array(':id' => 'node-' . $this->node->nid, ':class' => 'link-wrapper')); + $this->assertTrue(count($count) == 2, print_r($count, TRUE)); + } + /** * Tests the node comment statistics. */ diff --git a/modules/search/search.api.php b/modules/search/search.api.php index 3f745bfdb..534c1e872 100644 --- a/modules/search/search.api.php +++ b/modules/search/search.api.php @@ -22,13 +22,11 @@ * on your module's type of content. If you want to have your content * indexed in the standard search index, your module should also implement * hook_update_index(). If your search type has settings, you can implement - * hook_search_admin() to add them to the search settings page. You can also - * alter the display of your module's search results by implementing - * hook_search_page(). You can use hook_form_FORM_ID_alter(), with - * FORM_ID set to 'search', to add fields to the search form (see - * node_form_search_form_alter() for an example). You can use - * hook_search_access() to limit access to searching, and hook_search_page() to - * override how search results are displayed. + * hook_search_admin() to add them to the search settings page. You can use + * hook_form_FORM_ID_alter(), with FORM_ID set to 'search_form', to add fields + * to the search form (see node_form_search_form_alter() for an example). + * You can use hook_search_access() to limit access to searching, + * and hook_search_page() to override how search results are displayed. * * @return * Array with optional keys: diff --git a/modules/tracker/tracker.test b/modules/tracker/tracker.test index 3cc227eae..a559f1b64 100644 --- a/modules/tracker/tracker.test +++ b/modules/tracker/tracker.test @@ -8,7 +8,6 @@ class TrackerTest extends DrupalWebTestCase { protected $user; protected $other_user; - protected $new_node; public static function getInfo() { return array(