public function MetatagFieldInstanceTest::setUp in Metatag 8
Overrides MigrateSourceTestBase::setUp
File
- tests/
src/ Kernel/ Plugin/ migrate/ source/ d7/ MetatagFieldInstanceTest.php, line 39
Class
- MetatagFieldInstanceTest
- Tests Metatag-D7 field instance source plugin.
Namespace
Drupal\Tests\metatag\Kernel\Plugin\migrate\source\d7Code
public function setUp() {
parent::setUp();
$this
->installEntitySchema('node');
$this
->installEntitySchema('taxonomy_term');
$this
->installEntitySchema('user');
$this
->installConfig(static::$modules);
$node_types = [
'first_content_type' => 'first_content_type',
'second_content_type' => 'second_content_type',
];
foreach ($node_types as $node_type) {
$node_type = NodeType::create([
'type' => $node_type,
'name' => $node_type,
]);
$node_type
->save();
}
// ['taxonomy_term', ['test_vocabulary' => 'test_vocabulary']],
// Vocabulary::create(['name' => 'test_vocabulary']);
// Setup vocabulary.
Vocabulary::create([
'vid' => 'test_vocabulary',
'name' => 'test_vocabulary',
])
->save();
// Create a term and a comment.
$term = Term::create([
'vid' => 'test_vocabulary',
'name' => 'term',
])
->save();
}