You are here

public function ConfigurationUITest::testMultiStopTrackingUI in Configuration Management 7

Tests the multi "Stop Tracking" feature.

File

tests/configuration.test, line 604
Tests for Configuration Management

Class

ConfigurationUITest

Code

public function testMultiStopTrackingUI() {
  $this
    ->trackConfigurations();

  // For tracked components, should exists a page to stop the tracking.
  $config = configuration_get_configuration();

  // Try to stop tracking a component that is a dependency of another component
  $edit = array();
  $edit['field[items][node-' . $this->type->type . '-body]'] = 1;
  $this
    ->drupalPost('admin/config/system/configuration', $edit, t('Stop Tracking'));

  // Submit the second step of the form
  $this
    ->drupalPost(NULL, array(), t('Stop Tracking'));
  $this
    ->assertRaw(t('You cannot stop tracking configurations of a component that is a dependency of another component.'));

  // Try to stop tracking all the components
  $edit = array();
  foreach ($this->trackedComponents as $component => $identifiers) {
    foreach ($identifiers as $identifier) {
      $edit[$component . '[items][' . $identifier . ']'] = 1;
    }
  }
  $this
    ->drupalPost('admin/config/system/configuration', $edit, t('Stop Tracking'));

  // Submit the second step of the form
  $this
    ->drupalPost(NULL, array(), t('Stop Tracking'));
  $this
    ->assertRaw(t('No Configurations were found. Please use the
      !export_link page to begin tracking new Configurations.', array(
    '!export_link' => l(t('Not Tracking'), 'admin/config/system/configuration/notracking'),
  )));
}