X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Fvideo_embed_field%2Ftests%2Fsrc%2FFunctional%2FFieldConfigurationTest.php;fp=web%2Fmodules%2Fcontrib%2Fvideo_embed_field%2Ftests%2Fsrc%2FFunctional%2FFieldConfigurationTest.php;h=786e36aa3954e2cfc23fed9a24d1ed7a30a953af;hb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;hp=0000000000000000000000000000000000000000;hpb=57c063afa3f66b07c4bbddc2d6129a96d90f0aad;p=yaffs-website diff --git a/web/modules/contrib/video_embed_field/tests/src/Functional/FieldConfigurationTest.php b/web/modules/contrib/video_embed_field/tests/src/Functional/FieldConfigurationTest.php new file mode 100644 index 000000000..786e36aa3 --- /dev/null +++ b/web/modules/contrib/video_embed_field/tests/src/Functional/FieldConfigurationTest.php @@ -0,0 +1,56 @@ +drupalLogin($this->createAdminUser()); + $this->createContentType(['type' => 'page', 'name' => 'Page']); + drupal_flush_all_caches(); + $this->drupalGet('admin/structure/types/manage/page/fields/add-field'); + $this->submitForm([ + 'new_storage_type' => 'video_embed_field', + 'label' => 'Video Embed', + 'field_name' => 'video_embed', + ], t('Save and continue')); + $this->submitForm([], t('Save field settings')); + $this->submitForm([ + 'label' => 'Video Embed', + 'description' => 'Some help.', + 'required' => '1', + 'default_value_input[field_video_embed][0][value]' => 'http://example.com', + 'settings[allowed_providers][vimeo]' => 'vimeo', + 'settings[allowed_providers][youtube]' => 'youtube', + 'settings[allowed_providers][youtube_playlist]' => 'youtube_playlist', + ], t('Save settings')); + $this->assertSession()->pageTextContains('Could not find a video provider to handle the given URL.'); + $this->submitForm([ + 'default_value_input[field_video_embed][0][value]' => 'https://www.youtube.com/watch?v=XgYu7-DQjDQ', + ], t('Save settings')); + $this->assertSession()->pageTextContains('Saved Video Embed configuration.'); + } + +}