comparison core/modules/media/tests/src/Functional/MediaRevisionTest.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children 129ea1e6d783
comparison
equal deleted inserted replaced
13:5fb285c0d0e3 14:1fec387a4317
78 $assert = $this->assertSession(); 78 $assert = $this->assertSession();
79 79
80 $uri = 'temporary://foo.txt'; 80 $uri = 'temporary://foo.txt';
81 file_put_contents($uri, $this->randomString(128)); 81 file_put_contents($uri, $this->randomString(128));
82 82
83 $this->createMediaType(['bundle' => 'file', 'new_revision' => TRUE], 'file');
84
83 // Create a media item. 85 // Create a media item.
84 $this->drupalGet('/media/add/file'); 86 $this->drupalGet('/media/add/file');
85 $page = $this->getSession()->getPage(); 87 $page = $this->getSession()->getPage();
86 $page->fillField('Name', 'Foobar'); 88 $page->fillField('Name', 'Foobar');
87 $page->attachFileToField('File', $this->container->get('file_system')->realpath($uri)); 89 $page->attachFileToField('File', $this->container->get('file_system')->realpath($uri));
114 /** 116 /**
115 * Tests creating revisions of a Image media item. 117 * Tests creating revisions of a Image media item.
116 */ 118 */
117 public function testImageMediaRevision() { 119 public function testImageMediaRevision() {
118 $assert = $this->assertSession(); 120 $assert = $this->assertSession();
121
122 $this->createMediaType(['bundle' => 'image', 'new_revision' => TRUE], 'image');
119 123
120 /** @var \Drupal\field\FieldConfigInterface $field */ 124 /** @var \Drupal\field\FieldConfigInterface $field */
121 // Disable the alt text field, because this is not a JavaScript test and 125 // Disable the alt text field, because this is not a JavaScript test and
122 // the alt text field will therefore not appear without a full page refresh. 126 // the alt text field will therefore not appear without a full page refresh.
123 $field = FieldConfig::load('media.image.field_media_image'); 127 $field = FieldConfig::load('media.image.field_media_image');