Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php declare(strict_types=1); namespace Drupal\Tests\comment\Kernel\Migrate\d7; use Dr..

Decoded Output download

<?php

declare(strict_types=1);

namespace Drupal\Tests\comment\Kernel\Migrate\d7;

use Drupalield\Entity\FieldStorageConfig;
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;

/**
 * Tests the migration of comment fields from Drupal 7.
 *
 * @group comment
 * @group migrate_drupal_7
 */
class MigrateCommentFieldTest extends MigrateDrupal7TestBase {

  /**
   * {@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
   */
  protected function assertEntity(string $comment_type): void {
    $entity = FieldStorageConfig::load('node.' . $comment_type);
    $this->assertInstanceOf(FieldStorageConfig::class, $entity);
    $this->assertSame('node', $entity->getTargetEntityTypeId());
    $this->assertSame('comment', $entity->getType());
    $this->assertSame($comment_type, $entity->getSetting('comment_type'));
  }

  /**
   * Tests the migrated comment fields.
   */
  public function testMigration(): void {
    $this->assertEntity('comment_node_page');
    $this->assertEntity('comment_node_article');
    $this->assertEntity('comment_node_blog');
    $this->assertEntity('comment_node_book');
    $this->assertEntity('comment_forum');
    $this->assertEntity('comment_node_test_content_type');
    $this->assertEntity('comment_node_et');
  }

}
 ?>

Did this file decode correctly?

Original Code

<?php

declare(strict_types=1);

namespace Drupal\Tests\comment\Kernel\Migrate\d7;

use Drupal\field\Entity\FieldStorageConfig;
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;

/**
 * Tests the migration of comment fields from Drupal 7.
 *
 * @group comment
 * @group migrate_drupal_7
 */
class MigrateCommentFieldTest extends MigrateDrupal7TestBase {

  /**
   * {@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
   */
  protected function assertEntity(string $comment_type): void {
    $entity = FieldStorageConfig::load('node.' . $comment_type);
    $this->assertInstanceOf(FieldStorageConfig::class, $entity);
    $this->assertSame('node', $entity->getTargetEntityTypeId());
    $this->assertSame('comment', $entity->getType());
    $this->assertSame($comment_type, $entity->getSetting('comment_type'));
  }

  /**
   * Tests the migrated comment fields.
   */
  public function testMigration(): void {
    $this->assertEntity('comment_node_page');
    $this->assertEntity('comment_node_article');
    $this->assertEntity('comment_node_blog');
    $this->assertEntity('comment_node_book');
    $this->assertEntity('comment_forum');
    $this->assertEntity('comment_node_test_content_type');
    $this->assertEntity('comment_node_et');
  }

}

Function Calls

None

Variables

None

Stats

MD5 dd5beb9a44aee9a00658a09510141c3a
Eval Count 0
Decode Time 108 ms