You are here

private function NodeRevisionsAutocleanTest::initializeSettings in Node Revisions Autoclean 8

Initialize autclean general settings.

Parameters

bool $enabledAutoclean: Enabled Autoclean.

5 calls to NodeRevisionsAutocleanTest::initializeSettings()
NodeRevisionsAutocleanTest::testConfiguration in tests/src/Functional/NodeRevisionsAutocleanTest.php
Test new configuration.
NodeRevisionsAutocleanTest::testDeleteDateRevisions in tests/src/Functional/NodeRevisionsAutocleanTest.php
Tests that revisions are deleted as they should be with date constraint.
NodeRevisionsAutocleanTest::testDeleteMultilanguageRevisions in tests/src/Functional/NodeRevisionsAutocleanTest.php
Tests node revisions autoclean with multiple languages.
NodeRevisionsAutocleanTest::testDeleteRevisions in tests/src/Functional/NodeRevisionsAutocleanTest.php
Tests that revisions are deleted as they should be.
NodeRevisionsAutocleanTest::testInitialRevisions in tests/src/Functional/NodeRevisionsAutocleanTest.php
Test revisions.

File

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

Class

NodeRevisionsAutocleanTest
Class NodeRevisionsAutocleanTest.

Namespace

Drupal\Tests\node_revisions_autoclean\Functional

Code

private function initializeSettings($enabledAutoclean = FALSE) {
  $config = \Drupal::configFactory()
    ->getEditable('node_revisions_autoclean.settings');
  $config
    ->set('enable_on_cron', $enabledAutoclean ? 1 : 0)
    ->set('enable_on_node_update', $enabledAutoclean ? 1 : 0)
    ->set('node.page', $enabledAutoclean ? 2 : -1)
    ->set('interval.page', '0')
    ->set('node.article', $enabledAutoclean ? 2 : -1)
    ->set('interval.article', $enabledAutoclean ? 'P1W' : '0')
    ->save(TRUE);
}