Verified Commit a15b0121 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3436671 by narendraR, Wim Leers, phenaproxima: Add validation constraints to system.cron

(cherry picked from commit b59a6f10)
parent fc904890
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
threshold:
  requirements_warning: 172800
  requirements_error: 1209600
logging: 1
logging: true
+2 −2
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ public function testInstallProfileConfigOverwrite() {
        'requirements_warning' => 172800,
        'requirements_error' => 1209600,
      ],
      'logging' => 1,
      'logging' => TRUE,
    ];
    // The expected active configuration altered by the install profile.
    $expected_profile_data = [
@@ -54,7 +54,7 @@ public function testInstallProfileConfigOverwrite() {
        'requirements_warning' => 259200,
        'requirements_error' => 1209600,
      ],
      'logging' => 1,
      'logging' => TRUE,
    ];
    $expected_profile_data = ['_core' => ['default_config_hash' => Crypt::hashBase64(serialize($expected_profile_data))]] + $expected_profile_data;

+1 −1
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ function (callable $hook, string $module) use (&$implementation_count) {
    $this->assertEquals($expected_count, $cron_detailed_count, "Cron added $cron_detailed_count of $expected_count new log entries");

    // Test disabling of detailed cron logging.
    $this->config('system.cron')->set('logging', 0)->save();
    $this->config('system.cron')->set('logging', FALSE)->save();
    $cron_count = $this->runCron();
    $this->assertEquals(1, $cron_count, "Cron added $cron_count of 1 new log entries");
  }
+1 −1
Original line number Diff line number Diff line
threshold:
  requirements_warning: 172800
  requirements_error: 1209600
logging: 1
logging: true
+11 −1
Original line number Diff line number Diff line
@@ -58,6 +58,8 @@ system.maintenance:
system.cron:
  type: config_object
  label: 'Cron settings'
  constraints:
    FullyValidatable: ~
  mapping:
    threshold:
      type: mapping
@@ -66,11 +68,19 @@ system.cron:
        requirements_warning:
          type: integer
          label: 'Requirements warning period'
          constraints:
            # @see system_requirements()
            Range:
              min: 60
        requirements_error:
          type: integer
          label: 'Requirements error period'
          constraints:
            # @see system_requirements()
            Range:
              min: 300
    logging:
      type: integer
      type: boolean
      label: 'Detailed cron logging'

system.date:
Loading