Commit 5f6c72cb authored by bircher's avatar bircher

Issue #2857985: Disable tests as they will not work with config_filter...

Issue #2857985: Disable tests as they will not work with config_filter approach. (see issue 2857900)
parent cfa7bb83
...@@ -54,14 +54,15 @@ class ConfigIgnoreHookTest extends WebTestBase { ...@@ -54,14 +54,15 @@ class ConfigIgnoreHookTest extends WebTestBase {
'import' => Yaml::encode($config->get()), 'import' => Yaml::encode($config->get()),
]; ];
// Submit a new single item config, with the changes. // @TODO: Test the hook differently, single import is not ignored.
$this->drupalPostForm('admin/config/development/configuration/single/import', $edit, t('Import')); // // Submit a new single item config, with the changes.
$this->drupalPostForm(NULL, [], t('Confirm')); // $this->drupalPostForm('admin/config/development/configuration/single/import', $edit, t('Import'));
// $this->drupalPostForm(NULL, [], t('Confirm'));
// Validate if the title from the imported config was rejected, due to the //
// hook implemented in the `config_ignore_hook_test` module. // // Validate if the title from the imported config was rejected, due to the
$this->drupalGet('<front>'); // // hook implemented in the `config_ignore_hook_test` module.
$this->assertText('Test import title'); // $this->drupalGet('<front>');
// $this->assertText('Test import title');
} }
} }
...@@ -53,16 +53,17 @@ class ConfigIgnoreTest extends WebTestBase { ...@@ -53,16 +53,17 @@ class ConfigIgnoreTest extends WebTestBase {
'import' => Yaml::encode($config->get()), 'import' => Yaml::encode($config->get()),
]; ];
// Submit a new single item config, with the changes. // @TODO: Test the hook differently, single import is not ignored.
$this->drupalPostForm('admin/config/development/configuration/single/import', $edit, t('Import')); // // Submit a new single item config, with the changes.
// $this->drupalPostForm('admin/config/development/configuration/single/import', $edit, t('Import'));
$this->drupalPostForm(NULL, array(), t('Confirm')); //
// $this->drupalPostForm(NULL, array(), t('Confirm'));
// Validate if the title from the imported config was rejected. //
$this->assertText('Test import'); // // Validate if the title from the imported config was rejected.
// $this->assertText('Test import');
// Validate that the user gets a message about what has been ignored. //
$this->assertText('The following config entity was ignored'); // // Validate that the user gets a message about what has been ignored.
// $this->assertText('The following config entity was ignored');
} }
...@@ -88,16 +89,17 @@ class ConfigIgnoreTest extends WebTestBase { ...@@ -88,16 +89,17 @@ class ConfigIgnoreTest extends WebTestBase {
'import' => Yaml::encode($config->get()), 'import' => Yaml::encode($config->get()),
]; ];
// Submit a new single item config, with the changes. // @TODO: Test the hook differently, single import is not ignored.
$this->drupalPostForm('admin/config/development/configuration/single/import', $edit, t('Import')); // // Submit a new single item config, with the changes.
// $this->drupalPostForm('admin/config/development/configuration/single/import', $edit, t('Import'));
$this->drupalPostForm(NULL, array(), t('Confirm')); //
// $this->drupalPostForm(NULL, array(), t('Confirm'));
// Validate if the title from the imported config was rejected. //
$this->assertText('Test import'); // // Validate if the title from the imported config was rejected.
// $this->assertText('Test import');
// Validate that the user gets a message about what has been ignored. //
$this->assertText('The following config entity was ignored'); // // Validate that the user gets a message about what has been ignored.
// $this->assertText('The following config entity was ignored');
} }
......
...@@ -34,28 +34,30 @@ class ConfigIgnoreTest extends BrowserTestBase { ...@@ -34,28 +34,30 @@ class ConfigIgnoreTest extends BrowserTestBase {
$this->config('system.site')->set('name', 'Test import')->save(); $this->config('system.site')->set('name', 'Test import')->save();
$this->config('system.date')->set('first_day', '0')->save(); $this->config('system.date')->set('first_day', '0')->save();
$this->config('config_ignore.settings')->set('ignored_config_entities', ['system.site'])->save(); $this->config('config_ignore.settings')->set('ignored_config_entities', ['system.site'])->save();
$destination = CONFIG_SYNC_DIRECTORY; // @TODO: Test this differently, I am not sure this is the best way.
$destination_dir = config_get_config_directory($destination); // $destination = CONFIG_SYNC_DIRECTORY;
/** @var CachedStorage $source_storage */ // $destination_dir = config_get_config_directory($destination);
$source_storage = \Drupal::service('config.storage'); // /** @var CachedStorage $source_storage */
$destination_storage = new FileStorage($destination_dir); // $source_storage = \Drupal::service('config.storage');
foreach ($source_storage->listAll() as $name) { // $destination_storage = new FileStorage($destination_dir);
$destination_storage->write($name, $source_storage->read($name)); // foreach ($source_storage->listAll() as $name) {
} // $destination_storage->write($name, $source_storage->read($name));
// }
// Login with a user that has permission to sync. config.
$this->drupalLogin($this->drupalCreateUser(['synchronize configuration'])); // @TODO: Test the ignored config differently, the table is not altered.
// // Login with a user that has permission to sync. config.
// Change the site name, which is supposed to look as an ignored change // $this->drupalLogin($this->drupalCreateUser(['synchronize configuration']));
// in on the sync. page. //
$this->config('system.site')->set('name', 'Test import with changed title')->save(); // // Change the site name, which is supposed to look as an ignored change
$this->config('system.date')->set('first_day', '1')->save(); // // in on the sync. page.
// $this->config('system.site')->set('name', 'Test import with changed title')->save();
// Validate that the sync. table informs the user that the config will be // $this->config('system.date')->set('first_day', '1')->save();
// ignored. //
$this->drupalGet('admin/config/development/configuration'); // // Validate that the sync. table informs the user that the config will be
$this->assertSession()->responseContains('✔'); // // ignored.
$this->assertSession()->responseContains('✖'); // $this->drupalGet('admin/config/development/configuration');
// $this->assertSession()->responseContains('✔');
// $this->assertSession()->responseContains('✖');
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment