Skip to content
Snippets Groups Projects
Commit 2155f016 authored by catch's avatar catch
Browse files

Issue #3402548 by alexpott, mikelutz, el7cosmos: YamlFileLoaderTest fails if...

Issue #3402548 by alexpott, mikelutz, el7cosmos: YamlFileLoaderTest fails if you have PECL yaml installed

(cherry picked from commit aac47f0d)
(cherry picked from commit bea5ccb1)
parent 870265ac
Branches
Tags
5 merge requests!11628Update file MediaLibraryWidget.php,!7564Revert "Issue #3364773 by roshnichordiya, Chris Matthews, thakurnishant_06,...,!5752Issue #3275828 by joachim, quietone, bradjones1, Berdir: document the reason...,!5627Issue #3261805: Field not saved when change of 0 on string start,!3106Issue #3017548: "Filtered HTML" text format does not support manual teaser break (<!--break-->)
Pipeline #52343 passed
Pipeline: drupal

#52353

    Pipeline: drupal

    #52352

      Pipeline: drupal

      #52351

        +1
        ......@@ -446,8 +446,8 @@ private function validate($content, $file)
        throw new InvalidArgumentException(sprintf('The service file "%s" is not valid. It should contain an array. Check your YAML syntax.', $file));
        }
        if ($invalid_keys = array_diff_key($content, array('parameters' => 1, 'services' => 1))) {
        throw new InvalidArgumentException(sprintf('The service file "%s" is not valid: it contains invalid keys %s. Services have to be added under "services" and Parameters under "parameters".', $file, $invalid_keys));
        if ($invalid_keys = array_keys(array_diff_key($content, array('parameters' => 1, 'services' => 1)))) {
        throw new InvalidArgumentException(sprintf('The service file "%s" is not valid: it contains invalid root key(s) "%s". Services have to be added under "services" and Parameters under "parameters".', $file, implode('", "', $invalid_keys)));
        }
        return $content;
        ......
        ......@@ -171,10 +171,16 @@ public function providerTestExceptions() {
        ],
        'YAML must be valid' => [<<<YAML
        do not:
        do this for the love of Foo Bar!
        do: this: for the love of Foo Bar!
        YAML,
        'The file "vfs://drupal/modules/example/example.yml" does not contain valid YAML',
        ],
        'YAML must have expected keys' => [<<<YAML
        "do not":
        do: this
        YAML,
        'The service file "vfs://drupal/modules/example/example.yml" is not valid: it contains invalid root key(s) "do not". Services have to be added under "services" and Parameters under "parameters".',
        ],
        ];
        }
        ......
        0% Loading or .
        You are about to add 0 people to the discussion. Proceed with caution.
        Please register or to comment