Updated to Drupal 8.5. Core Media not yet in use.
[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    * @var bool
18    */
19   protected $strictConfigSchema = FALSE;
20
21   /**
22    * {@inheritdoc}
23    */
24   public static $modules = [
25     'video_embed_field',
26     'comment',
27     'datetime',
28     'filter',
29     'image',
30     'link',
31     'node',
32     'taxonomy',
33     'telephone',
34     'text',
35   ];
36
37   /**
38    * {@inheritdoc}
39    */
40   protected function getFixtureFilePath() {
41     return __DIR__ . '/../../fixtures/drupal7-vef-2-x.php.gz';
42   }
43
44   /**
45    * {@inheritdoc}
46    */
47   protected function setUp() {
48     parent::setUp();
49
50     $this->installEntitySchema('node');
51     $this->installEntitySchema('comment');
52     $this->installConfig(static::$modules);
53
54     $this->executeMigrations([
55       'd7_user_role',
56       'd7_user',
57       'd7_node_type',
58       'd7_comment_type',
59       'd7_field',
60       'd7_field_instance',
61       'd7_node:page',
62     ]);
63   }
64
65   /**
66    * Test the emfield migration.
67    */
68   public function testMigration() {
69     $migrated_vimeo = $this->loadEntityByLabel('Vimeo Example');
70     $migrated_youtube = $this->loadEntityByLabel('YouTube Example');
71     $this->assertEquals('https://vimeo.com/21681203', $migrated_vimeo->field_video->value);
72     $this->assertEquals('https://www.youtube.com/watch?v=XgYu7-DQjDQ', $migrated_youtube->field_video->value);
73   }
74
75 }