commit 18a8f2e96cfb4a4dfd00e0368340eae1504717dd Author: Andy Postnikov Date: Fri Feb 22 20:10:50 2013 +0400 Rename method to formatter diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentInterfaceTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentInterfaceTest.php index dc2e4a8..a0d8d37 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->setWidgetSettings('default_mode', COMMENT_MODE_THREADED, 'Comment paging changed.'); + $this->setFormatterSettings('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 34a1021..12635d3 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->setWidgetSettings('default_mode', COMMENT_MODE_THREADED, 'Comment paging changed.'); + $this->setFormatterSettings('default_mode', COMMENT_MODE_THREADED, 'Comment paging changed.'); $this->drupalLogout(); // Post comment. diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentPagerTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentPagerTest.php index 15aad21..b84aad7 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentPagerTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentPagerTest.php @@ -37,7 +37,7 @@ function testCommentPaging() { $comments[] = $this->postComment($node, $this->randomName(), $this->randomName(), TRUE); $comments[] = $this->postComment($node, $this->randomName(), $this->randomName(), TRUE); - $this->setWidgetSettings('default_mode', COMMENT_MODE_FLAT, 'Comment paging changed.'); + $this->setFormatterSettings('default_mode', COMMENT_MODE_FLAT, 'Comment paging changed.'); // Set comments to one per page so that we are able to test paging without // needing to insert large numbers of comments. @@ -77,7 +77,7 @@ function testCommentPaging() { // If we switch to threaded mode, the replies on the oldest comment // should be bumped to the first page and comment 6 should be bumped // to the second page. - $this->setWidgetSettings('default_mode', COMMENT_MODE_THREADED, 'Switched to threaded mode.'); + $this->setFormatterSettings('default_mode', COMMENT_MODE_THREADED, 'Switched to threaded mode.'); $this->drupalGet('node/' . $node->nid, array('query' => array('page' => 0))); $this->assertTrue($this->commentExists($reply, TRUE), 'In threaded mode, reply appears on page 1.'); $this->assertFalse($this->commentExists($comments[1]), 'In threaded mode, comment 2 has been bumped off of page 1.'); @@ -137,7 +137,7 @@ function testCommentOrderingThreading() { // - 2 // - 5 - $this->setWidgetSettings('default_mode', COMMENT_MODE_FLAT, 'Comment paging changed.'); + $this->setFormatterSettings('default_mode', COMMENT_MODE_FLAT, 'Comment paging changed.'); $expected_order = array( 0, @@ -151,7 +151,7 @@ function testCommentOrderingThreading() { $this->drupalGet('node/' . $node->nid); $this->assertCommentOrder($comments, $expected_order); - $this->setWidgetSettings('default_mode', COMMENT_MODE_THREADED, 'Switched to threaded mode.'); + $this->setFormatterSettings('default_mode', COMMENT_MODE_THREADED, 'Switched to threaded mode.'); $expected_order = array( 0, @@ -232,7 +232,7 @@ function testCommentNewPageIndicator() { // - 2 // - 5 - $this->setWidgetSettings('default_mode', COMMENT_MODE_FLAT, 'Comment paging changed.'); + $this->setFormatterSettings('default_mode', COMMENT_MODE_FLAT, 'Comment paging changed.'); $expected_pages = array( 1 => 5, // Page of comment 5 @@ -250,7 +250,7 @@ function testCommentNewPageIndicator() { $this->assertIdentical($expected_page, $returned_page, format_string('Flat mode, @new replies: expected page @expected, returned page @returned.', array('@new' => $new_replies, '@expected' => $expected_page, '@returned' => $returned_page))); } - $this->setWidgetSettings('default_mode', COMMENT_MODE_THREADED, 'Switched to threaded mode.'); + $this->setFormatterSettings('default_mode', COMMENT_MODE_THREADED, 'Switched to threaded mode.'); $expected_pages = array( 1 => 5, // Page of comment 5 diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php index 69b59ca..e720646 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php @@ -40,7 +40,7 @@ function testCommentPreview() { $this->setCommentPreview(DRUPAL_OPTIONAL); $this->setCommentForm(TRUE); $this->setCommentSubject(TRUE); - $this->setWidgetSettings('default_mode', COMMENT_MODE_THREADED, 'Comment paging changed.'); + $this->setFormatterSettings('default_mode', COMMENT_MODE_THREADED, 'Comment paging changed.'); $this->drupalLogout(); // Login as web user and add a signature and a user picture. diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentStatisticsTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentStatisticsTest.php index 9dc76a4..7157a61 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->setWidgetSettings('default_mode', COMMENT_MODE_THREADED, 'Comment paging changed.'); + $this->setFormatterSettings('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/CommentTestBase.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php index e46956a..28bbc2b 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php @@ -232,7 +232,7 @@ function setCommentPreview($mode) { * comments; FALSE if it should be displayed on its own page. */ function setCommentForm($enabled) { - $this->setWidgetSettings('form_location', ($enabled ? COMMENT_FORM_BELOW : COMMENT_FORM_SEPARATE_PAGE), 'Comment controls ' . ($enabled ? 'enabled' : 'disabled') . '.'); + $this->setFormatterSettings('form_location', ($enabled ? COMMENT_FORM_BELOW : COMMENT_FORM_SEPARATE_PAGE), 'Comment controls ' . ($enabled ? 'enabled' : 'disabled') . '.'); } /** @@ -255,7 +255,7 @@ function setCommentAnonymous($level) { * Comments per page value. */ function setCommentsPerPage($number) { - $this->setWidgetSettings('per_page', $number, format_string('Number of comments per page set to @number.', array('@number' => $number))); + $this->setFormatterSettings('per_page', $number, format_string('Number of comments per page set to @number.', array('@number' => $number))); } /** @@ -268,7 +268,7 @@ function setCommentsPerPage($number) { * @param string $message * Status message to display. */ - function setWidgetSettings($name, $value, $message) { + function setFormatterSettings($name, $value, $message) { $display = entity_get_display('node', 'article', 'default'); $settings = $display->getComponent('comment'); $settings['settings'][$name] = $value; diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentThreadingTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentThreadingTest.php index c8fa3fc..f2cbbbe 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->setWidgetSettings('default_mode', COMMENT_MODE_THREADED, 'Comment paging changed.'); + $this->setFormatterSettings('default_mode', COMMENT_MODE_THREADED, 'Comment paging changed.'); $this->drupalLogout(); // Create a node.