diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterConfigTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterConfigTest.php new file mode 100644 index 0000000..4727a7f --- /dev/null +++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterConfigTest.php @@ -0,0 +1,62 @@ + 'Filter config', + 'description' => 'Tests config functionality for formats', + 'group' => 'Filter', + ); + } + + protected function setUp() { + parent::setUp(); + + $this->drupalLogin($this->drupalCreateUser(array('synchronize configuration'))); + } + + /** + * Tests importing a new format. + */ + public function testImportConfig() { + $staging = $this->container->get('config.storage.staging'); + + // Rename an existing format, disable it, and assign it to a role. + $config_data = config('filter.format.filter_test')->get(); + $config_data['format'] = 'test'; + $config_data['status'] = 0; + $config_data['roles'][] = 'anonymous'; + $staging->write('filter.format.test', $config_data); + + // Add an entry to the manifest. + $manifest = config('manifest.filter.format')->get(); + $manifest += array('test' => array('name' => 'filter.format.test')); + $staging->write('manifest.filter.format', $manifest); + + // Import the new format. + $this->drupalGet('admin/config/development/sync'); + $this->drupalPost(NULL, array(), t('Import all')); + $this->assertText(t('There is no configuration to import.')); + } + +}