commit 6383c4d7c88ea5b53427f4319673e98a960fb007 Author: Andy Postnikov Date: Mon Feb 11 04:04:54 2013 +0400 fixed some tests diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module index 8bebc4b..299cbb0 100644 --- a/core/modules/comment/comment.module +++ b/core/modules/comment/comment.module @@ -1087,6 +1087,7 @@ function comment_node_update_index(Node $node, $langcode) { if ($index_comments) { foreach (comment_get_comment_fields('node') as $field_name => $info) { + // @todo Get settings from efault view mode. $instance = field_info_instance('node', $field_name, $node->type); $mode = $instance['settings']['comment']['comment_default_mode']; $comments_per_page = $instance['settings']['comment']['comment_default_per_page']; @@ -1387,6 +1388,7 @@ function comment_get_display_ordinal($cid, $instance) { */ function comment_get_display_page($cid, $instance) { $ordinal = comment_get_display_ordinal($cid, $instance); + // @todo Get settings from default display. $comments_per_page = $instance['settings']['comment']['comment_default_per_page']; return floor($ordinal / $comments_per_page); } diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentInterfaceTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentInterfaceTest.php index 41ecb1d..ea6ac26 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentInterfaceTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentInterfaceTest.php @@ -30,7 +30,7 @@ function testCommentInterface() { $this->setCommentPreview(DRUPAL_DISABLED); $this->setCommentForm(TRUE); $this->setCommentSubject(FALSE); - $this->setCommentSettings('comment_default_mode', COMMENT_MODE_THREADED, 'Comment paging changed.'); + $this->setWidgetSettings('default_mode', COMMENT_MODE_THREADED, 'Comment paging changed.'); $this->drupalLogout(); // Post comment #1 without subject or preview. diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentNodeAccessTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentNodeAccessTest.php index f8a8afd..34a1021 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentNodeAccessTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentNodeAccessTest.php @@ -57,7 +57,7 @@ function testThreadedCommentView() { $this->setCommentPreview(DRUPAL_DISABLED); $this->setCommentForm(TRUE); $this->setCommentSubject(TRUE); - $this->setCommentSettings('comment_default_mode', COMMENT_MODE_THREADED, 'Comment paging changed.'); + $this->setWidgetSettings('default_mode', COMMENT_MODE_THREADED, 'Comment paging changed.'); $this->drupalLogout(); // Post comment. diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentStatisticsTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentStatisticsTest.php index 77b5efd..9dc76a4 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentStatisticsTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentStatisticsTest.php @@ -44,7 +44,7 @@ function testCommentNodeCommentStatistics() { $this->setCommentPreview(DRUPAL_DISABLED); $this->setCommentForm(TRUE); $this->setCommentSubject(FALSE); - $this->setCommentSettings('comment_default_mode', COMMENT_MODE_THREADED, 'Comment paging changed.'); + $this->setWidgetSettings('default_mode', COMMENT_MODE_THREADED, 'Comment paging changed.'); $this->drupalLogout(); // Checks the initial values of node comment statistics with no comment. diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentThreadingTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentThreadingTest.php index b8dd07a..d8fee0d 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentThreadingTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentThreadingTest.php @@ -29,7 +29,7 @@ function testCommentThreading() { $this->setCommentPreview(DRUPAL_DISABLED); $this->setCommentForm(TRUE); $this->setCommentSubject(TRUE); - $this->setCommentSettings('comment_default_mode', COMMENT_MODE_THREADED, 'Comment paging changed.'); + $this->setWidgetSettings('default_mode', COMMENT_MODE_THREADED, 'Comment paging changed.'); $this->drupalLogout(); // Create a node. diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentUserTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentUserTest.php index f8dc15c..621ab14 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentUserTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentUserTest.php @@ -321,8 +321,8 @@ function testCommentUser() { drupal_flush_all_caches(); $this->drupalGet('user/' . $this->web_user->uid); $this->assertPattern('@]*>Comments@', 'Comments were displayed.'); - $this->assertLink('Log in', 1, 'Link to log in was found.'); - $this->assertLink('register', 1, 'Link to register was found.'); + $this->assertLink('Log in', 0, 'Link to log in was found.'); + $this->assertLink('register', 0, 'Link to register was found.'); user_role_change_permissions(DRUPAL_ANONYMOUS_RID, array( 'access comments' => FALSE,