ConfigImportUploadTest.php in Zircon Profile 8.0
File
core/modules/config/src/Tests/ConfigImportUploadTest.php
View source
<?php
namespace Drupal\config\Tests;
use Drupal\simpletest\WebTestBase;
class ConfigImportUploadTest extends WebTestBase {
protected $webUser;
public static $modules = array(
'config',
);
protected function setUp() {
parent::setUp();
$this->webUser = $this
->drupalCreateUser(array(
'import configuration',
));
$this
->drupalLogin($this->webUser);
}
function testImport() {
$this
->drupalGet('admin/config/development/configuration/full/import');
$this
->assertResponse(200);
$text_file = current($this
->drupalGetTestFiles('text'));
$edit = array(
'files[import_tarball]' => drupal_realpath($text_file->uri),
);
$this
->drupalPostForm('admin/config/development/configuration/full/import', $edit, t('Upload'));
$this
->assertText(t('Could not extract the contents of the tar file'));
}
}