$this->assertTrue(is_file($this->image->uri), "The image file we're going to upload exists.");
// "Browse" for the desired file.
- $edit = ['files[image]' => drupal_realpath($this->image->uri)];
+ $edit = ['files[image]' => \Drupal::service('file_system')->realpath($this->image->uri)];
// Post the form.
$this->drupalPostForm('form_test/form-state-values-clean-advanced', $edit, t('Submit'));