Verified Commit 18cbe89f authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3439932 by phenaproxima, narendraR, Wim Leers, larowlan: Add validation...

Issue #3439932 by phenaproxima, narendraR, Wim Leers, larowlan: Add validation constraints to system.image and system.image.gd

(cherry picked from commit 68628cce)
parent 5ed786fd
Loading
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -317,18 +317,31 @@ system.file:
system.image:
  type: config_object
  label: 'Image settings'
  constraints:
    FullyValidatable: ~
  mapping:
    toolkit:
      type: string
      label: 'Toolkit'
      constraints:
        PluginExists:
          manager: 'image.toolkit.manager'
          interface: '\Drupal\Core\ImageToolkit\ImageToolkitInterface'

system.image.gd:
  type: config_object
  label: 'Image settings'
  constraints:
    FullyValidatable: ~
  mapping:
    jpeg_quality:
      type: integer
      label: 'JPEG quality'
      constraints:
        # @see \Drupal\system\Plugin\ImageToolkit\GDToolkit::buildConfigurationForm()
        Range:
          min: 0
          max: 100

system.mail:
  type: config_object
+1 −0
Original line number Diff line number Diff line
@@ -160,6 +160,7 @@ public function testSpecialCharacters(string $config_name, string $property, str
   *   is expected to raise a "plugin does not exist" error.
   *
   * @testWith ["system.mail", "interface.0"]
   *   ["system.image", "toolkit"]
   */
  public function testInvalidPluginId(string $config_name, string $property): void {
    $config = $this->config($config_name);