function FieldDiscoveryTest::setUp

Same name in this branch
  1. 10 core/modules/migrate_drupal/tests/src/Unit/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Unit\FieldDiscoveryTest::setUp()
  2. 10 core/modules/migrate_drupal/tests/src/Kernel/d6/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Kernel\d6\FieldDiscoveryTest::setUp()
Same name in other branches
  1. 9 core/modules/migrate_drupal/tests/src/Unit/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Unit\FieldDiscoveryTest::setUp()
  2. 9 core/modules/migrate_drupal/tests/src/Kernel/d6/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Kernel\d6\FieldDiscoveryTest::setUp()
  3. 9 core/modules/migrate_drupal/tests/src/Kernel/d7/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Kernel\d7\FieldDiscoveryTest::setUp()
  4. 8.9.x core/modules/migrate_drupal/tests/src/Unit/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Unit\FieldDiscoveryTest::setUp()
  5. 8.9.x core/modules/migrate_drupal/tests/src/Kernel/d6/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Kernel\d6\FieldDiscoveryTest::setUp()
  6. 8.9.x core/modules/migrate_drupal/tests/src/Kernel/d7/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Kernel\d7\FieldDiscoveryTest::setUp()
  7. 11.x core/modules/migrate_drupal/tests/src/Unit/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Unit\FieldDiscoveryTest::setUp()
  8. 11.x core/modules/migrate_drupal/tests/src/Kernel/d6/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Kernel\d6\FieldDiscoveryTest::setUp()
  9. 11.x core/modules/migrate_drupal/tests/src/Kernel/d7/FieldDiscoveryTest.php \Drupal\Tests\migrate_drupal\Kernel\d7\FieldDiscoveryTest::setUp()

Overrides MigrateDrupal7TestBase::setUp

File

core/modules/migrate_drupal/tests/src/Kernel/d7/FieldDiscoveryTest.php, line 75

Class

FieldDiscoveryTest
Test FieldDiscovery Service against Drupal 7.

Namespace

Drupal\Tests\migrate_drupal\Kernel\d7

Code

protected function setUp() : void {
    parent::setUp();
    $this->installConfig(static::$modules);
    $node_types = [
        'page' => 'comment_node_page',
        'article' => 'comment_node_article',
        'blog' => 'comment_node_blog',
        'book' => 'comment_node_book',
        'et' => 'comment_node_et',
        'forum' => 'comment_forum',
        'test_content_type' => 'comment_node_test_content_type',
        'a_thirty_two_character_type_name' => 'a_thirty_two_character_type_name',
    ];
    foreach ($node_types as $node_type => $comment_type) {
        NodeType::create([
            'type' => $node_type,
            'name' => $this->randomString(),
        ])
            ->save();
        CommentType::create([
            'id' => $comment_type,
            'label' => $this->randomString(),
            'target_entity_type_id' => 'node',
        ])
            ->save();
    }
    Vocabulary::create([
        'vid' => 'test_vocabulary',
        'name' => 'Test',
    ])->save();
    $this->executeMigrations([
        'd7_field',
        'd7_comment_type',
        'd7_taxonomy_vocabulary',
        'd7_field_instance',
    ]);
    $this->fieldDiscovery = $this->container
        ->get('migrate_drupal.field_discovery');
    $this->migrationPluginManager = $this->container
        ->get('plugin.manager.migration');
    $this->fieldPluginManager = $this->container
        ->get('plugin.manager.migrate.field');
    $this->logger = $this->container
        ->get('logger.channel.migrate_drupal');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.