comparison core/modules/taxonomy/tests/src/Functional/TaxonomyImageTest.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
comparison
equal deleted inserted replaced
13:5fb285c0d0e3 14:1fec387a4317
78 78
79 // Create a term and upload the image. 79 // Create a term and upload the image.
80 $files = $this->drupalGetTestFiles('image'); 80 $files = $this->drupalGetTestFiles('image');
81 $image = array_pop($files); 81 $image = array_pop($files);
82 $edit['name[0][value]'] = $this->randomMachineName(); 82 $edit['name[0][value]'] = $this->randomMachineName();
83 $edit['files[field_test_0]'] = drupal_realpath($image->uri); 83 $edit['files[field_test_0]'] = \Drupal::service('file_system')->realpath($image->uri);
84 $this->drupalPostForm('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/add', $edit, t('Save')); 84 $this->drupalPostForm('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/add', $edit, t('Save'));
85 $this->drupalPostForm(NULL, ['field_test[0][alt]' => $this->randomMachineName()], t('Save')); 85 $this->drupalPostForm(NULL, ['field_test[0][alt]' => $this->randomMachineName()], t('Save'));
86 $terms = entity_load_multiple_by_properties('taxonomy_term', ['name' => $edit['name[0][value]']]); 86 $terms = entity_load_multiple_by_properties('taxonomy_term', ['name' => $edit['name[0][value]']]);
87 $term = reset($terms); 87 $term = reset($terms);
88 $this->assertText(t('Created new term @name.', ['@name' => $term->getName()])); 88 $this->assertText(t('Created new term @name.', ['@name' => $term->getName()]));