function ComposerPluginsValidatorTest::providerComplexInvalidCases

Generates complex invalid test cases based on the simple test cases.

Return value

\Generator

File

core/modules/package_manager/tests/src/Kernel/ComposerPluginsValidatorTest.php, line 376

Class

ComposerPluginsValidatorTest
@covers \Drupal\package_manager\Validator\ComposerPluginsValidator @group package_manager @internal

Namespace

Drupal\Tests\package_manager\Kernel

Code

public static function providerComplexInvalidCases() : \Generator {
    $valid_cases = iterator_to_array(static::providerSimpleValidCases());
    $invalid_cases = iterator_to_array(static::providerSimpleInvalidCases());
    $all_config = NestedArray::mergeDeepArray(array_map(fn(array $c) => $c[0], $valid_cases + $invalid_cases));
    $all_packages = NestedArray::mergeDeepArray(array_map(fn(array $c) => $c[1], $valid_cases + $invalid_cases));
    (yield 'complex combination' => [
        $all_config,
        $all_packages,
        [
            ValidationResult::createError([
                new TranslatableMarkup('<code>not-cweagans/not-composer-patches</code>'),
                new TranslatableMarkup('<code>also-not-cweagans/also-not-composer-patches</code>'),
                new TranslatableMarkup('<code>phpstan/extension-installer</code> is supported, but only version <code>^1.1</code>, found <code>20.1</code>.'),
                new TranslatableMarkup('<code>dealerdirect/phpcodesniffer-composer-installer</code> is supported, but only version <code>^0.7.1 || ^1.0.0</code>, found <code>0.6.1</code>.'),
            ], new TranslatableMarkup('Unsupported Composer plugins were detected.')),
        ],
    ]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.