MigrateRecipe72Test.php in Recipe 8.2
File
tests/src/Kernel/Migrate/recipe72/MigrateRecipe72Test.php
View source
<?php
namespace Drupal\Tests\recipe\Kernel\Migrate\recipe72;
use Drupal\node\Entity\Node;
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
class MigrateRecipe72Test extends MigrateDrupal7TestBase {
protected static $modules = [
'ingredient',
'menu_ui',
'node',
'rdf',
'recipe',
'text',
];
protected function getFixtureFilePath() {
return __DIR__ . '/../../../../fixtures/recipe72.php';
}
protected function setUp() : void {
parent::setUp();
$this
->installEntitySchema('node');
$this
->installConfig(static::$modules);
$this
->installSchema('node', [
'node_access',
]);
$this
->executeMigrations([
'd7_user_role',
'd7_user',
'd7_node_type',
'd7_node',
'recipe72_recipe',
]);
}
public function testRecipeFields() {
$node = Node::load(1);
$this
->assertEquals('1', $node->recipe_yield_amount->value);
$this
->assertSame('Glass', $node->recipe_yield_unit->value);
}
}