video_embed_field-8.x-2.4/tests/src/Kernel/Drupal6EmfieldMigrationTest.php

tests/src/Kernel/Drupal6EmfieldMigrationTest.php
<?php

namespace Drupal\Tests\video_embed_field\Kernel;

use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;

/**
 * Test the Drupal 6 emfield migration.
 *
 * @group video_embed_field
 */
class Drupal6EmfieldMigrationTest extends MigrateDrupal6TestBase {

  use EntityLoadTrait;

  /**
   * {@inheritdoc}
   *
   * phpcs:disable DrupalPractice.Objects.StrictSchemaDisabled.StrictConfigSchema
   */
  protected $strictConfigSchema = FALSE;

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

  /**
   * {@inheritdoc}
   */
  protected function getFixtureFilePath() {
    return __DIR__ . '/../../fixtures/drupal6-emfield-2-x.php.gz';
  }

  /**
   * Test the emfield migration.
   */
  public function testEmfieldMigration() {
    $this->migrateContent();
    $migrated_vimeo = $this->loadEntityByLabel('Vimeo Example');
    $migrated_youtube = $this->loadEntityByLabel('YouTube Example');
    $this->assertEquals('https://vimeo.com/21681203', $migrated_vimeo->field_video->value);
    $this->assertEquals('https://www.youtube.com/watch?v=XgYu7-DQjDQ', $migrated_youtube->field_video->value);
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc