You are here

public function NodeRevisionsAutocleanTest::testConfigForm in Node Revisions Autoclean 8

Test initial config form with article & page.

File

tests/src/Functional/NodeRevisionsAutocleanTest.php, line 191

Class

NodeRevisionsAutocleanTest
Class NodeRevisionsAutocleanTest.

Namespace

Drupal\Tests\node_revisions_autoclean\Functional

Code

public function testConfigForm() {
  $assert = $this
    ->assertSession();
  $user = $this
    ->drupalCreateUser([
    'configure revisions autoclean settings',
  ]);
  $this
    ->drupalLogin($user);
  $this
    ->drupalGet('/admin/config/content/revisions-autoclean');
  $assert
    ->checkboxNotChecked('enable_on_cron');
  $assert
    ->checkboxNotChecked('enable_on_node_update');
  $assert
    ->fieldExists('node__article');
  $assert
    ->fieldExists('interval__article');
  $assert
    ->fieldExists('node_enable_date_article');
  $assert
    ->fieldValueEquals('interval__article', '0');
  $assert
    ->checkboxNotChecked('node_enable_date_article');
  $assert
    ->fieldValueEquals('node__article', '-1');
  $assert
    ->fieldExists('node__page');
  $assert
    ->fieldExists('interval__page');
  $assert
    ->fieldExists('node_enable_date_page');
  $assert
    ->fieldValueEquals('interval__page', '0');
  $assert
    ->checkboxNotChecked('node_enable_date_page');
  $assert
    ->fieldValueEquals('node__page', '-1');
}