Skip to content
Snippets Groups Projects
Verified Commit 68628cce 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
parent 82d325ee
No related branches found
No related tags found
No related merge requests found
...@@ -313,18 +313,31 @@ system.file: ...@@ -313,18 +313,31 @@ system.file:
system.image: system.image:
type: config_object type: config_object
label: 'Image settings' label: 'Image settings'
constraints:
FullyValidatable: ~
mapping: mapping:
toolkit: toolkit:
type: string type: string
label: 'Toolkit' label: 'Toolkit'
constraints:
PluginExists:
manager: 'image.toolkit.manager'
interface: '\Drupal\Core\ImageToolkit\ImageToolkitInterface'
system.image.gd: system.image.gd:
type: config_object type: config_object
label: 'Image settings' label: 'Image settings'
constraints:
FullyValidatable: ~
mapping: mapping:
jpeg_quality: jpeg_quality:
type: integer type: integer
label: 'JPEG quality' label: 'JPEG quality'
constraints:
# @see \Drupal\system\Plugin\ImageToolkit\GDToolkit::buildConfigurationForm()
Range:
min: 0
max: 100
system.mail: system.mail:
type: config_object type: config_object
......
...@@ -160,6 +160,7 @@ public function testSpecialCharacters(string $config_name, string $property, str ...@@ -160,6 +160,7 @@ public function testSpecialCharacters(string $config_name, string $property, str
* is expected to raise a "plugin does not exist" error. * is expected to raise a "plugin does not exist" error.
* *
* @testWith ["system.mail", "interface.0"] * @testWith ["system.mail", "interface.0"]
* ["system.image", "toolkit"]
*/ */
public function testInvalidPluginId(string $config_name, string $property): void { public function testInvalidPluginId(string $config_name, string $property): void {
$config = $this->config($config_name); $config = $this->config($config_name);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment