comparison core/modules/image/tests/src/Functional/ImageFieldTestBase.php @ 16:c2387f117808

Routine composer update
author Chris Cannam
date Tue, 10 Jul 2018 15:07:59 +0100
parents 1fec387a4317
children 129ea1e6d783
comparison
equal deleted inserted replaced
15:e200cb7efeb3 16:c2387f117808
85 public function uploadNodeImage($image, $field_name, $type, $alt = '') { 85 public function uploadNodeImage($image, $field_name, $type, $alt = '') {
86 $edit = [ 86 $edit = [
87 'title[0][value]' => $this->randomMachineName(), 87 'title[0][value]' => $this->randomMachineName(),
88 ]; 88 ];
89 $edit['files[' . $field_name . '_0]'] = \Drupal::service('file_system')->realpath($image->uri); 89 $edit['files[' . $field_name . '_0]'] = \Drupal::service('file_system')->realpath($image->uri);
90 $this->drupalPostForm('node/add/' . $type, $edit, t('Save and publish')); 90 $this->drupalPostForm('node/add/' . $type, $edit, t('Save'));
91 if ($alt) { 91 if ($alt) {
92 // Add alt text. 92 // Add alt text.
93 $this->drupalPostForm(NULL, [$field_name . '[0][alt]' => $alt], t('Save and publish')); 93 $this->drupalPostForm(NULL, [$field_name . '[0][alt]' => $alt], t('Save'));
94 } 94 }
95 95
96 // Retrieve ID of the newly created node from the current URL. 96 // Retrieve ID of the newly created node from the current URL.
97 $matches = []; 97 $matches = [];
98 preg_match('/node\/([0-9]+)/', $this->getUrl(), $matches); 98 preg_match('/node\/([0-9]+)/', $this->getUrl(), $matches);