Interim commit.
[yaffs-website] / web / modules / contrib / video_embed_field / tests / src / Kernel / Drupal7MigrationTest.php
1 <?php
2
3 namespace Drupal\Tests\video_embed_field\Kernel;
4
5 use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
6
7 /**
8  * Test the Drupal 7 to 8 video_embed_field migration.
9  *
10  * @group video_embed_field
11  */
12 class Drupal7MigrationTest extends MigrateDrupal7TestBase {
13
14   use EntityLoadTrait;
15
16   /**
17    * {@inheritdoc}
18    */
19   public static $modules = [
20     'video_embed_field',
21     'comment',
22     'datetime',
23     'filter',
24     'image',
25     'link',
26     'node',
27     'taxonomy',
28     'telephone',
29     'text',
30   ];
31
32   /**
33    * {@inheritdoc}
34    */
35   protected function getFixtureFilePath() {
36     return __DIR__ . '/../../fixtures/drupal7-vef-2-x.php.gz';
37   }
38
39   /**
40    * {@inheritdoc}
41    */
42   protected function setUp() {
43     parent::setUp();
44
45     $this->installEntitySchema('node');
46     $this->installEntitySchema('comment');
47     $this->installConfig(static::$modules);
48
49     $this->executeMigrations([
50       'd7_user_role',
51       'd7_user',
52       'd7_node_type',
53       'd7_comment_type',
54       'd7_field',
55       'd7_field_instance',
56       'd7_node:page',
57     ]);
58   }
59
60   /**
61    * Test the emfield migration.
62    */
63   public function testMigration() {
64     $migrated_vimeo = $this->loadEntityByLabel('Vimeo Example');
65     $migrated_youtube = $this->loadEntityByLabel('YouTube Example');
66     $this->assertEquals('https://vimeo.com/21681203', $migrated_vimeo->field_video->value);
67     $this->assertEquals('https://www.youtube.com/watch?v=XgYu7-DQjDQ', $migrated_youtube->field_video->value);
68   }
69
70 }