You are here

public function ConfigurationUITest::testStopTrackingUI in Configuration Management 7

Tests the "stop tracking" page.

File

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

Class

ConfigurationUITest

Code

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

  // For tracked components, should exists a page to stop the tracking.
  $config = configuration_get_configuration();
  foreach ($this->trackedComponents as $component => $identifiers) {
    foreach ($identifiers as $identifier) {
      $this
        ->drupalGet('admin/config/system/configuration/config/' . $component . '/' . $identifier . '/delete');
      if (empty($config[$component][$identifier]['parent'])) {
        $this
          ->assertResponse(200, t('Stop tracking page for tracked component: @component (@identifier) exists', array(
          '@component' => $component,
          '@identifier' => $identifier,
        )));
      }
      else {
        $this
          ->assertResponse(404, 'Stop tracking page for a component that is a dependency of other component does not exists');
      }
    }
  }

  // For non-tracked components, it shouldn't exists that page page.
  $this
    ->drupalGet('admin/config/system/configuration/config/filter/full_html/delete');
  $this
    ->assertResponse(404, 'Stop tracking page for non tracked component does not exists');

  // Test Stop Tracking feature.
  $edit = array();
  $this
    ->drupalPost('admin/config/system/configuration/config/filter/filtered_html/delete', array(), t('Stop Tracking'));

  // The checkbox for filtered_html should not be found.
  $this
    ->assertNoFieldByName('filter[items][filtered_html]', "filtered_html", "Checkbox for filtered_html found");

  // For the recently untracked component, it shouldn't exists a page to stop
  // the tracking.
  $this
    ->drupalGet('admin/config/system/configuration/config/filter/filtered_html/delete');
  $this
    ->assertResponse(404, 'Stop tracking page for non tracked component does not exists');
}