ConfigInstallerFrDirectorySyncTest.php in Configuration installer 8
File
tests/src/Functional/ConfigInstallerFrDirectorySyncTest.php
View source
<?php
namespace Drupal\Tests\config_installer\Functional;
class ConfigInstallerFrDirectorySyncTest extends ConfigInstallerTestBase {
protected $syncDir;
protected function setUp() {
$this->syncDir = 'public://' . $this
->randomMachineName(128);
parent::setUp();
}
protected function setUpSyncForm() {
drupal_mkdir($this->syncDir);
$this
->extractTarball($this
->getTarball(), $this->syncDir);
$this
->drupalPostForm(NULL, [
'sync_directory' => drupal_realpath($this->syncDir),
], 'Save and continue');
}
protected function setUpInstallConfigureForm() {
$params = $this->parameters['forms']['install_configure_form'];
unset($params['site_name']);
unset($params['site_mail']);
unset($params['update_status_module']);
$edit = $this
->translatePostValues($params);
$this
->drupalPostForm(NULL, $edit, 'Enregistrer et continuer');
}
public function testInstaller() {
require_once \Drupal::root() . '/core/includes/install.inc';
$this
->assertText('Félicitations, vous avez installé');
$this
->assertText(drupal_install_profile_distribution_name());
$this
->assertEqual('fr', \Drupal::config('system.site')
->get('default_langcode'));
$this
->assertFalse(\Drupal::service('language_manager')
->isMultilingual());
}
protected function getTarball() {
return $this
->versionTarball('missing-language-entity.tar.gz');
}
}