diff core/modules/media/tests/src/FunctionalJavascript/MediaSourceAudioVideoTest.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 1fec387a4317
children
line wrap: on
line diff
--- a/core/modules/media/tests/src/FunctionalJavascript/MediaSourceAudioVideoTest.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/core/modules/media/tests/src/FunctionalJavascript/MediaSourceAudioVideoTest.php	Thu Feb 28 13:21:36 2019 +0000
@@ -39,7 +39,7 @@
     $formatter = $display->getComponent($field_name)['type'];
     $this->assertSame('file_audio', $formatter);
 
-    // Create a media asset and verify that the <audio> tag is present.
+    // Create a media asset.
     file_put_contents('public://file.mp3', str_repeat('t', 10));
     $file = File::create([
       'uri' => 'public://file.mp3',
@@ -54,7 +54,12 @@
     $this->assertNotEmpty($result);
     $page->pressButton('Save');
 
+    // Verify that there is a creation message and that it contains a link to
+    // the media entity.
     $assert_session->pageTextContains("$type_name Audio media asset has been created.");
+    $this->drupalGet($this->assertLinkToCreatedMedia());
+
+    // Verify that the <audio> tag is present on the media entity view.
     $assert_session->elementExists('css', "audio > source[type='audio/mpeg']");
   }
 
@@ -83,7 +88,7 @@
     $formatter = $display->getComponent($field_name)['type'];
     $this->assertSame('file_video', $formatter);
 
-    // Create a media asset and verify that the <video> tag is present.
+    // Create a media asset.
     file_put_contents('public://file.mp4', str_repeat('t', 10));
     $file = File::create([
       'uri' => 'public://file.mp4',
@@ -98,7 +103,12 @@
     $this->assertNotEmpty($result);
     $page->pressButton('Save');
 
+    // Verify that there is a creation message and that it contains a link to
+    // the media entity.
     $assert_session->pageTextContains("$type_name Video media asset has been created.");
+
+    $this->drupalGet($this->assertLinkToCreatedMedia());
+    // Verify that the <video> tag is present on the media entity view.
     $assert_session->elementExists('css', "video > source[type='video/mp4']");
   }