diff --git a/core/modules/comment/config/views.view.comments.yml b/core/modules/comment/config/views.view.comments.yml index ac5595a..5b14903 100644 --- a/core/modules/comment/config/views.view.comments.yml +++ b/core/modules/comment/config/views.view.comments.yml @@ -1389,7 +1389,7 @@ display: group_type: group admin_label: '' operator: '=' - value: '0' + value: '1' group: '1' exposed: '0' expose: diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentActionsTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentActionsTest.php index 4d0bd9c..1e2576a 100644 --- a/core/modules/comment/lib/Drupal/comment/Tests/CommentActionsTest.php +++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentActionsTest.php @@ -94,26 +94,4 @@ function testCommentDeleteAction() { $this->assertTrue(empty($comment), 'Comment was deleted'); } - /** - * Verifies that a watchdog message has been entered. - * - * @param $watchdog_message - * The watchdog message. - * @param $variables - * The array of variables passed to watchdog(). - * @param $message - * The assertion message. - */ - function assertWatchdogMessage($watchdog_message, $variables, $message) { - $status = (bool) db_query_range("SELECT 1 FROM {watchdog} WHERE message = :message AND variables = :variables", 0, 1, array(':message' => $watchdog_message, ':variables' => serialize($variables)))->fetchField(); - return $this->assert($status, format_string('@message', array('@message'=> $message))); - } - - /** - * Clears watchdog. - */ - function clearWatchdog() { - db_truncate('watchdog')->execute(); - } - } diff --git a/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php b/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php index cdbff1a..556f16a 100644 --- a/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php +++ b/core/modules/views/lib/Drupal/views/Tests/DefaultViewsTest.php @@ -24,6 +24,13 @@ class DefaultViewsTest extends ViewTestBase { public static $modules = array('views', 'node', 'search', 'comment', 'taxonomy', 'block'); /** + * The vocabulary used for creating terms. + * + * @var \Drupal\taxonomy\VocabularyInterface + */ + protected $vocabulary; + + /** * An array of argument arrays to use for default views. * * @var array @@ -60,9 +67,9 @@ protected function setUp() { $this->vocabulary->save(); // Setup a field and instance. - $this->field_name = drupal_strtolower($this->randomName()); + $field_name = drupal_strtolower($this->randomName()); entity_create('field_entity', array( - 'field_name' => $this->field_name, + 'field_name' => $field_name, 'type' => 'taxonomy_term_reference', 'settings' => array( 'allowed_values' => array( @@ -74,7 +81,7 @@ protected function setUp() { ) ))->save(); entity_create('field_instance', array( - 'field_name' => $this->field_name, + 'field_name' => $field_name, 'entity_type' => 'node', 'bundle' => 'page', ))->save(); @@ -84,10 +91,10 @@ protected function setUp() { for ($i = 0; $i <= 10; $i++) { $user = $this->drupalCreateUser(); - $term = $this->createTerm($this->vocabulary); + $term = $this->createTerm(); $values = array('created' => $time, 'type' => 'page'); - $values[$this->field_name][]['target_id'] = $term->id(); + $values[$field_name][]['target_id'] = $term->id(); // Make every other node promoted. if ($i % 2) { @@ -105,10 +112,37 @@ protected function setUp() { 'node_type' => 'node_type_' . $node->bundle(), ); entity_create('comment', $comment)->save(); + + $comment = array( + 'uid' => $user->uid, + 'nid' => $node->nid, + 'node_type' => 'node_type_' . $node->bundle(), + 'status' => 0, + ); + entity_create('comment', $comment)->save(); + } } /** + * Returns a new term with random properties in vocabulary $vid. + */ + function createTerm() { + $filter_formats = filter_formats(); + $format = array_pop($filter_formats); + $term = entity_create('taxonomy_term', array( + 'name' => $this->randomName(), + 'description' => $this->randomName(), + // Use the first available text format. + 'format' => $format->format, + 'vid' => $this->vocabulary->id(), + 'langcode' => Language::LANGCODE_NOT_SPECIFIED, + )); + $term->save(); + return $term; + } + + /** * Test that all Default views work as expected. */ public function testDefaultViews() { @@ -141,24 +175,6 @@ public function testDefaultViews() { } /** - * Returns a new term with random properties in vocabulary $vid. - */ - function createTerm($vocabulary) { - $filter_formats = filter_formats(); - $format = array_pop($filter_formats); - $term = entity_create('taxonomy_term', array( - 'name' => $this->randomName(), - 'description' => $this->randomName(), - // Use the first available text format. - 'format' => $format->format, - 'vid' => $vocabulary->id(), - 'langcode' => Language::LANGCODE_NOT_SPECIFIED, - )); - $term->save(); - return $term; - } - - /** * Tests the archive view. */ public function testArchiveView() {