ConfigInstallerTarballTest.php in Configuration installer 8
File
tests/src/Functional/ConfigInstallerTarballTest.php
View source
<?php
namespace Drupal\Tests\config_installer\Functional;
class ConfigInstallerTarballTest extends ConfigInstallerTestBase {
protected function setUpSyncForm() {
$this
->drupalPostForm(NULL, [
'files[import_tarball]' => '',
], 'Save and continue');
$this
->assertText('No file upload provided and the sync directory is empty');
$this
->drupalPostForm(NULL, [
'files[import_tarball]' => $this
->versionTarball('broken.tar.gz'),
], 'Save and continue');
$this
->assertText('Could not extract the contents of the tar file.');
$this
->drupalPostForm(NULL, [
'files[import_tarball]' => $this
->versionTarball('empty.tar.gz'),
], 'Save and continue');
$this
->assertText('The tar file contoins no files.');
$this
->drupalPostForm(NULL, [
'files[import_tarball]' => $this
->versionTarball('minimal-validation-fail.tar.gz'),
], 'Save and continue');
$this
->assertText('The tar file contoins no files.');
$this
->assertText('The configuration cannot be imported because it failed validation for the following reasons:');
$this
->assertText('Configuration foo.bar depends on the foo extension that will not be installed after import.');
$this
->drupalPostForm(NULL, [
'files[import_tarball]' => $this
->getTarball(),
], 'Save and continue');
}
}