You are here

public function ConfigurationCtoolsWebTestCase::testViewsImportDatastoreToActivestore in Configuration Management 7

Tests that configurations that are marked as overriden are reverted properly.

File

tests/configuration.ctools.test, line 105
Test cases for contrib modules supported by configuration.

Class

ConfigurationCtoolsWebTestCase
Configuration test case for ctools.

Code

public function testViewsImportDatastoreToActivestore() {
  $this
    ->trackViewsConfigurations();

  // Test frontpage view overrides.
  // Edit the view and change the title.
  $new_title = $this
    ->randomName(16);
  $edit = array(
    'title' => $new_title,
  );
  $this
    ->drupalPost('admin/structure/views/nojs/display/frontpage/page/title', $edit, t('Apply'));
  $this
    ->drupalPost('admin/structure/views/view/frontpage/edit/page', array(), t('Save'));

  // @todo remove this line once we have a observer for ctools components.
  $this
    ->drupalPost('admin/config/system/configuration/settings', array(), t('Check for new configurations'));
  $this
    ->assertRaw($this->configuration_needs_saving_text, t('Activestore overriden message is present'));

  // Try to revert
  $edit = array();
  $edit['views_view[items][frontpage]'] = TRUE;
  $this
    ->drupalPost('admin/config/system/configuration', $edit, t('Import Datastore to Activestore'));

  // @todo remove this line once we have a observer for ctools components.
  $this
    ->drupalPost('admin/config/system/configuration/settings', array(), t('Check for new configurations'));
  $this
    ->assertNoRaw($this->configuration_needs_saving_text, t('Activestore overriden message not present'));
}