X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fvideo_embed_field%2Fmodules%2Fvideo_embed_media%2Ftests%2Fsrc%2FFunctional%2FUpgradePathTest.php;fp=web%2Fmodules%2Fcontrib%2Fvideo_embed_field%2Fmodules%2Fvideo_embed_media%2Ftests%2Fsrc%2FFunctional%2FUpgradePathTest.php;h=0000000000000000000000000000000000000000;hp=52c4aa3d42bf3f42e18cdb724618fd8a7f637382;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/web/modules/contrib/video_embed_field/modules/video_embed_media/tests/src/Functional/UpgradePathTest.php b/web/modules/contrib/video_embed_field/modules/video_embed_media/tests/src/Functional/UpgradePathTest.php deleted file mode 100644 index 52c4aa3d4..000000000 --- a/web/modules/contrib/video_embed_field/modules/video_embed_media/tests/src/Functional/UpgradePathTest.php +++ /dev/null @@ -1,96 +0,0 @@ -drupalLogin($this->createAdminUser()); - - // Create a media_entity_embeddable_video bundle and field. - $this->drupalGet('admin/structure/media/add'); - $this->submitForm([ - 'label' => 'embeddable Video Bundle', - 'id' => 'embeddable_bundle', - 'type' => 'embeddable_video', - ], 'Save media bundle'); - $this->assertSession()->pageTextContains('The media bundle embeddable Video Bundle has been added.'); - $this->drupalGet('admin/structure/media/manage/embeddable_bundle/fields/add-field'); - $this->submitForm([ - 'new_storage_type' => 'string', - 'label' => 'Video Text Field', - 'field_name' => 'video_text_field', - ], t('Save and continue')); - $this->submitForm([], t('Save field settings')); - $this->submitForm([], t('Save settings')); - $this->drupalGet('admin/structure/media/manage/embeddable_bundle'); - $this->submitForm(['type_configuration[embeddable_video][source_field]' => 'field_video_text_field'], t('Save media bundle')); - $this->drupalGet('media/add/embeddable_bundle'); - $this->submitForm([ - 'field_video_text_field[0][value]' => 'https://www.youtube.com/watch?v=gnERPdAiuSo', - 'name[0][value]' => 'Test Media Entity', - ], t('Save')); - - // Install video_embed_field. - $this->container->get('module_installer')->install(['video_embed_media'], TRUE); - - $this->assertUpgradeComplete(); - - // Uninstall the module and ensure everything is still okay. - $this->drupalGet('admin/modules/uninstall'); - $this->submitForm([ - 'uninstall[media_entity_embeddable_video]' => TRUE, - ], t('Uninstall')); - $this->submitForm([], 'Uninstall'); - - $this->assertUpgradeComplete(); - } - - /** - * Assert the upgrade was successful. - */ - protected function assertUpgradeComplete() { - // Ensure the new type is selected. - $this->drupalGet('admin/structure/media/manage/embeddable_bundle'); - $this->assertTrue(!empty($this->getSession()->getPage()->find('xpath', '//option[@value="video_embed_field" and @selected="selected"]')), 'The media type was updated.'); - // Ensure the media entity has updated values. - $this->drupalGet('media/1/edit'); - $this->assertEquals($this->getSession()->getPage()->find('css', 'input[name="field_video_text_field[0][value]"]')->getValue(), 'https://www.youtube.com/watch?v=gnERPdAiuSo', 'Field values were copied.'); - } - -}