diff --git a/core/modules/node/src/Tests/PagePreviewTest.php b/core/modules/node/src/Tests/PagePreviewTest.php index 14e21fa..206ef82 100644 --- a/core/modules/node/src/Tests/PagePreviewTest.php +++ b/core/modules/node/src/Tests/PagePreviewTest.php @@ -282,6 +282,20 @@ function testPagePreview() { $this->drupalPostForm('node/add/page', array($title_key => 'Preview'), t('Preview')); $this->clickLink(t('Back to content editing')); $this->assertRaw('edit-submit'); + + // Assert multiple items can be added and are not lost when previewing. + $test_image_1 = current($this->drupalGetTestFiles('image', 39325)); + $edit_image_1['files[field_image_0][]'] = drupal_realpath($test_image_1->uri); + $test_image_2 = current($this->drupalGetTestFiles('image', 39325)); + $edit_image_2['files[field_image_1][]'] = drupal_realpath($test_image_2->uri); + $edit['field_image[0][alt]'] = 'Alt 1'; + + $this->drupalPostForm('node/add/page', $edit_image_1, t('Upload')); + $this->drupalPostForm(NULL, $edit, t('Preview')); + $this->clickLink(t('Back to content editing')); + $this->assertFieldByName('files[field_image_1][]'); + $this->drupalPostForm(NULL, $edit_image_2, t('Upload')); + $this->assertNoFieldByName('files[field_image_1][]'); } /**