/**
* Tests importing configuration.
*/
public function testImport() { // Verify access to the config upload form.
$this->
drupalGet('admin/config/development/configuration/full/import'
);
$this->
assertSession()->
statusCodeEquals(200
);
// Attempt to upload a non-tar file.
$text_file =
$this->
getTestFiles('text'
)[0
];
$edit =
['files[import_tarball]' => \Drupal::
service('file_system'
)->
realpath($text_file->uri
)];
$this->
drupalGet('admin/config/development/configuration/full/import'
);
$this->
submitForm($edit, 'Upload'
);
$this->
assertSession()->
pageTextContains('Could not extract the contents of the tar file'
);
// Make the sync directory read-only.
$directory = Settings::
get('config_sync_directory'
);
\Drupal::
service('file_system'
)->
chmod($directory, 0555
);
$this->
drupalGet('admin/config/development/configuration/full/import'
);
$this->
assertSession()->
pageTextContains("The directory
$directory is not writable."
);
// Ensure submit button for \Drupal\config\Form\ConfigImportForm is