migrateCommentTypes example

'language',
    'node',
    'text',
  ];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->startCollectingMessages();
    $this->migrateCommentTypes();
    $this->executeMigrations([
      'language',
      'd7_language_content_comment_settings',
    ]);
  }

  /** * {@inheritdoc} */
  public static function migrateDumpAlter(KernelTestBase $test) {
    // Disable comment entity translation.
'language',
    'node',
    'text',
  ];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->startCollectingMessages();
    $this->migrateCommentTypes();
    $this->executeMigrations([
      'language',
      'd7_language_content_comment_settings',
    ]);
  }

  /** * Tests migration of content language settings. */
  public function testLanguageCommentSettings() {
    // Confirm there is no message about a missing bundle.
/** * {@inheritdoc} */
  protected static $modules = ['node', 'comment', 'text', 'menu_ui'];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->migrateCommentTypes();
    $this->executeMigration('d7_comment_entity_form_display_subject');
  }

  /** * Asserts that the comment subject field is visible for a node type. * * @param string $id * The entity form display ID. * * @internal */
  
/** * {@inheritdoc} */
  protected static $modules = ['node', 'comment', 'text', 'menu_ui'];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->migrateContentTypes();
    $this->migrateCommentTypes();
    $this->executeMigrations([
      'd7_comment_field',
      'd7_comment_field_instance',
      'd7_comment_entity_display',
    ]);
  }

  /** * Asserts various aspects of a comment component in an entity view display. * * @param string $id * The entity ID. * @param string $component_id * The ID of the display component. * * @internal */

  protected function getFixtureFilePath() {
    return __DIR__ . '/../../../fixtures/drupal7.php';
  }

  /** * Executes all field migrations. */
  protected function migrateFields() {
    $this->executeMigration('d7_field');
    $this->migrateContentTypes();
    $this->migrateCommentTypes();
    $this->executeMigrations(['d7_taxonomy_vocabulary', 'd7_field_instance']);
  }

  /** * Executes all user migrations. * * @param bool $include_pictures * (optional) If TRUE, migrates user pictures. Defaults to TRUE. */
  protected function migrateUsers($include_pictures = TRUE) {
    $migrations = ['d7_user_role', 'd7_user'];

    
/** * {@inheritdoc} */
  protected static $modules = ['node', 'comment', 'text', 'menu_ui'];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->migrateContentTypes();
    $this->migrateCommentTypes();
    $this->executeMigrations([
      'd7_comment_field',
      'd7_comment_field_instance',
      'd7_comment_entity_form_display',
    ]);
  }

  /** * Asserts various aspects of a comment component in an entity form display. * * @param string $id * The entity ID. * @param string $component_id * The ID of the form component. * * @internal */
protected function assertEntity(string $id, string $label): void {
    $entity = CommentType::load($id);
    $this->assertInstanceOf(CommentType::class$entity);
    $this->assertSame($label$entity->label());
    $this->assertSame('node', $entity->getTargetEntityTypeId());
  }

  /** * Tests the migrated comment types. */
  public function testMigration() {
    $this->migrateCommentTypes();

    $comment_fields = [
      'comment' => 'Default comment setting',
      'comment_default_mode' => 'Default display mode',
      'comment_default_per_page' => 'Default comments per page',
      'comment_anonymous' => 'Anonymous commenting',
      'comment_subject_field' => 'Comment subject field',
      'comment_preview' => 'Preview comment',
      'comment_form_location' => 'Location of comment submission form',
    ];
    foreach ($comment_fields as $field => $description) {
      
/** * {@inheritdoc} */
  protected static $modules = ['node', 'comment', 'text'];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->migrateCommentTypes();
    $this->executeMigration('d7_comment_field');
  }

  /** * Asserts a comment field entity. * * @param string $comment_type * The comment type. * * @internal */
  
/** * {@inheritdoc} */
  protected static $modules = ['node', 'comment', 'text', 'menu_ui'];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->migrateContentTypes();
    $this->migrateCommentTypes();
    $this->executeMigrations([
      'd7_comment_field',
      'd7_comment_field_instance',
    ]);
  }

  /** * Asserts a comment field instance entity. * * @param string $bundle * The bundle ID. * @param string $field_name * The field name. * @param int $default_value * The field's default_value setting. * @param int $default_mode * The field's default_mode setting. * @param int $per_page * The field's per_page setting. * @param int $anonymous * The field's anonymous setting. * @param bool $form_location * The field's form_location setting. * @param int $preview * The field's preview setting. * * @internal */
Home | Imprint | This part of the site doesn't use cookies.