loadFixture example

'text',
  ];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    // Add a node classic migrate table to the destination site so that tests     // run by default with the classic node migrations.     $this->makeNodeMigrateMapTable(NodeMigrateType::NODE_MIGRATE_TYPE_CLASSIC, '6');
    $this->loadFixture($this->getFixtureFilePath());
  }

  /** * Gets the path to the fixture file. */
  protected function getFixtureFilePath() {
    return __DIR__ . '/../../../fixtures/drupal6.php';
  }

  /** * Executes all user migrations. * * @param bool $include_pictures * If TRUE, migrates user pictures. */
'migrate_drupal_ui',
    // Will generate an error for a missing source module.     'migration_provider_test',
  ];

  /** * Test missing source provider. * * @dataProvider providerSourceProvider */
  public function testSourceProvider($path_to_database) {
    $this->loadFixture($this->getModulePath('migrate_drupal') . $path_to_database);

    $session = $this->assertSession();

    // Start the upgrade process.     $this->submitCredentialForm();

    // Ensure we get errors about missing modules.     $session->pageTextContains('Resolve all issues below to continue the upgrade.');
    $session->pageTextContains('The no_source_module plugin must define the source_module property.');

    // Uninstall the module causing the missing module error messages.
use NodeMigrateTypeTestTrait;

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    // Add a node classic migrate table to the destination site so that tests     // run by default with the classic node migrations.     $this->makeNodeMigrateMapTable(NodeMigrateType::NODE_MIGRATE_TYPE_CLASSIC, '7');
    $this->loadFixture($this->getFixtureFilePath());
  }

  /** * Gets the path to the fixture file. */
  protected function getFixtureFilePath() {
    return __DIR__ . '/../../../../fixtures/drupal7.php';
  }

  /** * Executes all user migrations. * * @param bool $include_pictures * (optional) If TRUE, migrates user pictures. Defaults to TRUE. */
'migrate_drupal_ui',
    'telephone',
    'book',
    'statistics',
  ];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->loadFixture($this->getModulePath('migrate_drupal') . '/tests/fixtures/drupal6.php');
  }

  /** * {@inheritdoc} */
  protected function getSourceBasePath() {
    return __DIR__ . '/files';
  }

  /** * {@inheritdoc} */
    'migrate_state_finished_test',
    'migrate_state_not_finished_test',
    // Test missing migrate_drupal.yml.     'migrate_state_no_upgrade_path',
  ];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->loadFixture($this->getModulePath('migrate_drupal') . '/tests/fixtures/drupal6.php');
  }

  /** * {@inheritdoc} */
  protected function getSourceBasePath() {
    return __DIR__ . '/files';
  }

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

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->loadFixture($this->getModulePath('tracker') . '/tests/fixtures/drupal7.php');
  }

  /** * Tests the review page. */
  public function testMigrateUpgradeReviewPage() {
    $this->prepare();
    // Start the upgrade process.     $this->submitCredentialForm();

    $session = $this->assertSession();
    

  protected static $modules = [
    'forum',
  ];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->loadFixture($this->getModulePath('forum') . '/tests/fixtures/drupal6.php');
  }

  /** * {@inheritdoc} */
  protected function getSourceBasePath() {
    return __DIR__;
  }

  /** * Tests that Forum is displayed in the will be upgraded list. */
'language',
    'migrate_drupal_ui',
    'statistics',
    'telephone',
  ];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->loadFixture($this->getModulePath('migrate_drupal') . '/tests/fixtures/drupal6.php');
  }

  /** * {@inheritdoc} */
  protected function getSourceBasePath() {
    return __DIR__ . '/files';
  }

  /** * {@inheritdoc} */
'migrate',
    'migrate_drupal',
    'migrate_drupal_ui',
  ];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->fs = \Drupal::service('file_system');
    $this->loadFixture($this->getModulePath('migrate_drupal') . '/tests/fixtures/drupal7.php');
  }

  /** * Executes all steps of migrations upgrade. * * @param string $file_private_path * The source database file_private_path value. * @param string $file_public_path * The source database file_public_path value. * @param string $file_temporary_path * The source database file_temporary_path value. * @param string $private * The path to the source private files. * @param string $public * The path to the source public files. * @param string $temporary * The path to the source temporary files. * * @dataProvider providerTestFilePath */
'update',
    // Test migrations states.     'migrate_state_finished_test',
    'migrate_state_not_finished_test',
  ];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->loadFixture($this->getModulePath('migrate_drupal') . '/tests/fixtures/drupal7.php');
  }

  /** * {@inheritdoc} */
  protected function getSourceBasePath() {
    return __DIR__ . '/files';
  }

  /** * {@inheritdoc} */
use NodeMigrateTypeTestTrait;

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    // Add a node classic migrate table to the destination site so that tests     // run by default with the classic node migrations.     $this->makeNodeMigrateMapTable(NodeMigrateType::NODE_MIGRATE_TYPE_CLASSIC, '7');
    $this->loadFixture($this->getFixtureFilePath());
  }

  /** * Gets the path to the fixture file. */
  protected function getFixtureFilePath() {
    return __DIR__ . '/../../../fixtures/drupal7.php';
  }

  /** * Executes all field migrations. */
// @todo remove in https://www.drupal.org/project/drupal/issues/3267040     // Delete the existing content made to test the ID Conflict form. Migrations     // are to be done on a site without content. The test of the ID Conflict     // form is being moved to its own issue which will remove the deletion     // of the created nodes.     // See https://www.drupal.org/project/drupal/issues/3087061.     $this->nodeStorage = $this->container->get('entity_type.manager')
      ->getStorage('node');
    $this->nodeStorage->delete($this->nodeStorage->loadMultiple());

    $this->loadFixture($this->getModulePath('migrate_drupal') . '/tests/fixtures/drupal7.php');
  }

  /** * {@inheritdoc} */
  protected function getSourceBasePath() {
    return __DIR__ . '/files';
  }

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

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();

    $this->loadFixture(\Drupal::service('extension.list.module')->getPath('migrate_drupal') . '/tests/fixtures/drupal7.php');
  }

  /** * Executes all steps of migrations upgrade. */
  public function testMigrateUpgradeExecute() {
    // Change fid 1 to a filename that does not exist.     $this->sourceDatabase
      ->update('file_managed')
      ->condition('fid', 1)
      ->fields([
        
'update',
    // Test migrations states.     'migrate_state_finished_test',
    'migrate_state_not_finished_test',
  ];

  /** * {@inheritdoc} */
  protected function setUp(): void {
    parent::setUp();
    $this->loadFixture($this->getModulePath('migrate_drupal') . '/tests/fixtures/drupal6.php');
  }

  /** * {@inheritdoc} */
  protected function getSourceBasePath() {
    return __DIR__ . '/files';
  }

  /** * {@inheritdoc} */
trait CreateMigrationsTrait {

  /** * Create instances of all Drupal 6 migrations. * * @return \Drupal\migrate\Plugin\MigrationInterface[] * The migrations */
  public function drupal6Migrations() {
    $dirs = \Drupal::service('module_handler')->getModuleDirectories();
    $migrate_drupal_directory = $dirs['migrate_drupal'];
    $this->loadFixture("$migrate_drupal_directory/tests/fixtures/drupal6.php");
    return \Drupal::service('plugin.manager.migration')->createInstancesByTag('Drupal 6');
  }

  /** * Create instances of all Drupal 7 migrations. * * @return \Drupal\migrate\Plugin\MigrationInterface[] * The migrations */
  public function drupal7Migrations() {
    $dirs = \Drupal::service('module_handler')->getModuleDirectories();
    
Home | Imprint | This part of the site doesn't use cookies.