Unverified Commit a22092a1 authored by Alex Pott's avatar Alex Pott
Browse files

[#3409588] task: Test validation constraint to type: plural_label in core.data_types.schema

By: smustgrave
By: alexpott
By: claudiu.cristea
By: wim leers
By: dxvargas
parent f01ae18d
Loading
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -308,3 +308,9 @@ config_test.validation:
      type: string
      constraints:
        UriHost: ~

config_test.with_plural_label:
  type: config_object
  mapping:
    label:
      type: plural_label
+8 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ class SimpleConfigValidationTest extends KernelTestBase {
  /**
   * {@inheritdoc}
   */
  protected static $modules = ['system'];
  protected static $modules = ['config_test', 'system'];

  /**
   * {@inheritdoc}
@@ -115,6 +115,12 @@ public static function providerSpecialCharacters(): array {
      '🤓',
      NULL,
    ];
    $data['plural label'] = [
      'config_test.with_plural_label',
      'label',
      "\x03",
      NULL,
    ];

    return $data;
  }
@@ -135,6 +141,7 @@ public static function providerSpecialCharacters(): array {
   */
  public function testSpecialCharacters(string $config_name, string $property, string $character, ?string $expected_error_message): void {
    $config = $this->config($config_name)
      ->set('langcode', 'en')
      ->set($property, "This has a special character: $character");

    $violations = $this->container->get('config.typed')