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/FunctionalJavascript/ConfigDeleteUITest.php, line 41

Class

ConfigDeleteUITest
Tests the user interface for deleting configuration.

Namespace

Drupal\Tests\config_delete\FunctionalJavascript

Code

public function testConfigDeletion() {
  $this
    ->drupalGet('admin/config/development/configuration/delete');
  $config = $this
    ->config('contact.form.personal');
  $this
    ->assertNotNull($config
    ->get('id'));
  $this
    ->getSession()
    ->getPage()
    ->selectFieldOption('config_type', 'contact_form');
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
  $this
    ->getSession()
    ->getPage()
    ->selectFieldOption('config_name', 'personal');
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
  $this
    ->getSession()
    ->getPage()
    ->pressButton('edit-submit');
  $this
    ->assertSession()
    ->pageTextContains($this
    ->t('Configuration "contact.form.personal" successfully deleted.'));
  $this
    ->rebuildContainer();
  $config = $this
    ->config('contact.form.personal');
  $this
    ->assertNull($config
    ->get('id'));
}