diff --git a/core/modules/comment/src/Tests/CommentPreviewTest.php b/core/modules/comment/src/Tests/CommentPreviewTest.php index b5b089a..8d188c3 100644 --- a/core/modules/comment/src/Tests/CommentPreviewTest.php +++ b/core/modules/comment/src/Tests/CommentPreviewTest.php @@ -28,48 +28,6 @@ class CommentPreviewTest extends CommentTestBase { protected $profile = 'standard'; /** - * @todo remove setUp() once https://www.drupal.org/node/2321385 lands. - */ - protected function setUp() { - parent::setUp(); - $entity_type = 'node'; - $bundle = 'article'; - $field_name = 'comment'; - // Assign widget settings for the 'default' form mode. - entity_get_form_display($entity_type, $bundle, 'default') - ->setComponent($field_name, array( - 'type' => 'comment_default', - 'weight' => 20, - )) - ->save(); - - // The comment field should be hidden in all other form displays. - foreach (\Drupal::entityManager()->getFormModes($entity_type) as $id => $form_mode) { - $display = entity_get_form_display($entity_type, $bundle, $id); - // Only update existing displays. - if ($display && !$display->isNew()) { - $display->removeComponent($field_name)->save(); - } - } - // Set default to display comment list. - entity_get_display($entity_type, $bundle, 'default') - ->setComponent($field_name, array( - 'label' => 'above', - 'type' => 'comment_default', - 'weight' => 20, - )) - ->save(); - // The comment field should be hidden in all other view displays. - foreach (\Drupal::entityManager()->getViewModes($entity_type) as $id => $view_mode) { - $display = entity_get_display($entity_type, $bundle, $id); - // Only update existing displays. - if ($display && !$display->isNew()) { - $display->removeComponent($field_name)->save(); - } - } - } - - /** * Tests comment preview. */ function testCommentPreview() { diff --git a/core/modules/comment/src/Tests/CommentTypeTest.php b/core/modules/comment/src/Tests/CommentTypeTest.php index 5801a96..8bad469 100644 --- a/core/modules/comment/src/Tests/CommentTypeTest.php +++ b/core/modules/comment/src/Tests/CommentTypeTest.php @@ -110,6 +110,7 @@ public function testCommentTypeEditing() { $this->clickLink('Manage fields'); $this->assertUrl(\Drupal::url('field_ui.overview_comment', array('comment_type' => 'comment'), array('absolute' => TRUE)), [], 'Original machine name was used in URL.'); $this->assertTrue($this->cssSelect('tr#comment-body'), 'Body field exists.'); + // Remove the body field. $this->drupalPostForm('admin/structure/comment/manage/comment/fields/comment.comment.comment_body/delete', array(), t('Delete')); // Resave the settings for this type. diff --git a/core/modules/forum/forum.install b/core/modules/forum/forum.install index 61acd56..544a601 100644 --- a/core/modules/forum/forum.install +++ b/core/modules/forum/forum.install @@ -5,10 +5,7 @@ * Install, update, and uninstall functions for the Forum module. */ -use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface; -use Drupal\field\Entity\FieldConfig; use Drupal\field\Entity\FieldStorageConfig; -use Drupal\comment\CommentManagerInterface; use Drupal\taxonomy\Entity\Term; /** diff --git a/core/modules/rdf/src/Tests/StandardProfileTest.php b/core/modules/rdf/src/Tests/StandardProfileTest.php index c2bfe68..05c2fac 100644 --- a/core/modules/rdf/src/Tests/StandardProfileTest.php +++ b/core/modules/rdf/src/Tests/StandardProfileTest.php @@ -104,44 +104,6 @@ class StandardProfileTest extends WebTestBase { protected function setUp() { parent::setUp(); - // @todo remove once https://www.drupal.org/node/2321385 lands. - $entity_type = 'node'; - $bundle = 'article'; - $field_name = 'comment'; - // Assign widget settings for the 'default' form mode. - entity_get_form_display($entity_type, $bundle, 'default') - ->setComponent($field_name, array( - 'type' => 'comment_default', - 'weight' => 20, - )) - ->save(); - - // The comment field should be hidden in all other form displays. - foreach (\Drupal::entityManager()->getFormModes($entity_type) as $id => $form_mode) { - $display = entity_get_form_display($entity_type, $bundle, $id); - // Only update existing displays. - if ($display && !$display->isNew()) { - $display->removeComponent($field_name)->save(); - } - } - // Set default to display comment list. - entity_get_display($entity_type, $bundle, 'default') - ->setComponent($field_name, array( - 'label' => 'above', - 'type' => 'comment_default', - 'weight' => 20, - )) - ->save(); - // The comment field should be hidden in all other view displays. - foreach (\Drupal::entityManager()->getViewModes($entity_type) as $id => $view_mode) { - $display = entity_get_display($entity_type, $bundle, $id); - // Only update existing displays. - if ($display && !$display->isNew()) { - $display->removeComponent($field_name)->save(); - } - } - // end @todo - $this->base_uri = \Drupal::url('', [], ['absolute' => TRUE]); // Create two test users. diff --git a/core/modules/user/src/Tests/UserPictureTest.php b/core/modules/user/src/Tests/UserPictureTest.php index 8ee3ff6..639c382 100644 --- a/core/modules/user/src/Tests/UserPictureTest.php +++ b/core/modules/user/src/Tests/UserPictureTest.php @@ -39,43 +39,6 @@ protected function setUp() { 'post comments', 'skip comment approval', )); - // @todo remove once https://www.drupal.org/node/2321385 lands. - $entity_type = 'node'; - $bundle = 'article'; - $field_name = 'comment'; - // Assign widget settings for the 'default' form mode. - entity_get_form_display($entity_type, $bundle, 'default') - ->setComponent($field_name, array( - 'type' => 'comment_default', - 'weight' => 20, - )) - ->save(); - - // The comment field should be hidden in all other form displays. - foreach (\Drupal::entityManager()->getFormModes($entity_type) as $id => $form_mode) { - $display = entity_get_form_display($entity_type, $bundle, $id); - // Only update existing displays. - if ($display && !$display->isNew()) { - $display->removeComponent($field_name)->save(); - } - } - // Set default to display comment list. - entity_get_display($entity_type, $bundle, 'default') - ->setComponent($field_name, array( - 'label' => 'above', - 'type' => 'comment_default', - 'weight' => 20, - )) - ->save(); - // The comment field should be hidden in all other view displays. - foreach (\Drupal::entityManager()->getViewModes($entity_type) as $id => $view_mode) { - $display = entity_get_display($entity_type, $bundle, $id); - // Only update existing displays. - if ($display && !$display->isNew()) { - $display->removeComponent($field_name)->save(); - } - } - // end @todo } /** diff --git a/core/profiles/standard/src/Tests/StandardTest.php b/core/profiles/standard/src/Tests/StandardTest.php index 8892c8b..3ba2347 100644 --- a/core/profiles/standard/src/Tests/StandardTest.php +++ b/core/profiles/standard/src/Tests/StandardTest.php @@ -23,48 +23,6 @@ class StandardTest extends WebTestBase { protected $profile = 'standard'; /** - * @todo remove setUp() once https://www.drupal.org/node/2321385 lands. - */ - protected function setUp() { - parent::setUp(); - $entity_type = 'node'; - $bundle = 'article'; - $field_name = 'comment'; - // Assign widget settings for the 'default' form mode. - entity_get_form_display($entity_type, $bundle, 'default') - ->setComponent($field_name, array( - 'type' => 'comment_default', - 'weight' => 20, - )) - ->save(); - - // The comment field should be hidden in all other form displays. - foreach (\Drupal::entityManager()->getFormModes($entity_type) as $id => $form_mode) { - $display = entity_get_form_display($entity_type, $bundle, $id); - // Only update existing displays. - if ($display && !$display->isNew()) { - $display->removeComponent($field_name)->save(); - } - } - // Set default to display comment list. - entity_get_display($entity_type, $bundle, 'default') - ->setComponent($field_name, array( - 'label' => 'above', - 'type' => 'comment_default', - 'weight' => 20, - )) - ->save(); - // The comment field should be hidden in all other view displays. - foreach (\Drupal::entityManager()->getViewModes($entity_type) as $id => $view_mode) { - $display = entity_get_display($entity_type, $bundle, $id); - // Only update existing displays. - if ($display && !$display->isNew()) { - $display->removeComponent($field_name)->save(); - } - } - } - - /** * Tests Standard installation profile. */ function testStandard() { diff --git a/core/profiles/standard/standard.install b/core/profiles/standard/standard.install index cf4769d..509f316 100644 --- a/core/profiles/standard/standard.install +++ b/core/profiles/standard/standard.install @@ -23,12 +23,6 @@ function standard_install() { // Set front page to "node". \Drupal::config('system.site')->set('page.front', 'node')->save(); - // @todo remove once https://www.drupal.org/node/2321385 lands. - // Hide the comment field in the rss view mode. - entity_get_display('node', 'article', 'rss') - ->removeComponent('comment') - ->save(); - // Allow visitor account creation with administrative approval. $user_settings = \Drupal::config('user.settings'); $user_settings->set('register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)->save();