You are here

public function ConfigDeleteUITest::testConfigDeletion in Config Delete 8

Same name in this branch
  1. 8 tests/src/Functional/ConfigDeleteUITest.php \Drupal\Tests\config_delete\Functional\ConfigDeleteUITest::testConfigDeletion()
  2. 8 tests/src/FunctionalJavascript/ConfigDeleteUITest.php \Drupal\Tests\config_delete\FunctionalJavascript\ConfigDeleteUITest::testConfigDeletion()

Tests config delete.

File

tests/src/Functional/ConfigDeleteUITest.php, line 58

Class

ConfigDeleteUITest
Tests the user interface for deleting configuration.

Namespace

Drupal\Tests\config_delete\Functional

Code

public function testConfigDeletion() {
  $config = $this
    ->config('automated_cron.settings');
  $this
    ->assertNotNull($config
    ->get('interval'));
  $form_values = [
    'config_type' => 'system.simple',
    'config_name' => 'automated_cron.settings',
  ];
  $this
    ->drupalPostForm('admin/config/development/configuration/delete', $form_values, 'Delete');
  $this
    ->assertSession()
    ->pageTextContains($this
    ->t('Configuration "automated_cron.settings" successfully deleted.'));
  $config = $this
    ->config('automated_cron.settings');
  $this
    ->assertNull($config
    ->get('interval'));
}