You are here

public function ConfigurationUISettingsTest::testSynchronizeUI in Configuration Management 7.2

File

ui/tests/configuration_ui.test, line 196
Tests for Configuration Management

Class

ConfigurationUISettingsTest

Code

public function testSynchronizeUI() {

  // Change the path to be able to read configurations from the test folder
  // Test the synchronize feature
  $web_user = $this
    ->drupalCreateUser(array(
    'administer configuration management',
  ));
  $this
    ->drupalLogin($web_user);

  // Test the Validations
  $edit = array(
    'configuration_config_path' => drupal_get_path('module', 'configuration') . '/tests/test_configs/',
    'configuration_remote_server' => TRUE,
  );
  $this
    ->drupalPost('admin/config/system/configuration/settings', $edit, t('Save configuration'));
  $this
    ->assertRaw('The configuration options have been saved.');
  $directory = 'non/existent/path';
  $edit = array(
    'configuration_config_path' => $directory,
    'configuration_remote_server' => TRUE,
  );
  $this
    ->drupalPost('admin/config/system/configuration/settings', $edit, t('Save configuration'));
  $this
    ->assertRaw(t('The directory %directory does not exist.', array(
    '%directory' => $directory,
  )));
  $edit = array();
  $this
    ->drupalPost('admin/config/system/configuration/sync', $edit, t('Synchronize configurations'));
  $this
    ->assertRaw('The following modules have been enabled:', 'Modules enabled');
  $this
    ->assertRaw(t('Imported %config', array(
    '%config' => 'content_type.article',
  )));
}