function ComposerPatchesValidatorTest::providerErrorDuringPreCreate

Data provider for testErrorDuringPreCreate().

Return value

mixed[][] The test cases.

File

core/modules/package_manager/tests/src/Kernel/ComposerPatchesValidatorTest.php, line 32

Class

ComposerPatchesValidatorTest
@covers \Drupal\package_manager\Validator\ComposerPatchesValidator @group package_manager @internal

Namespace

Drupal\Tests\package_manager\Kernel

Code

public static function providerErrorDuringPreCreate() : array {
    $summary = t('Problems detected related to the Composer plugin <code>cweagans/composer-patches</code>.');
    return [
        'INVALID: exit-on-patch-failure missing' => [
            static::CONFIG_ALLOWED_PLUGIN | static::REQUIRE_PACKAGE_FROM_ROOT,
            [
                ValidationResult::createError([
                    t('The <code>composer-exit-on-patch-failure</code> key is not set to <code>true</code> in the <code>extra</code> section of <code>composer.json</code>.'),
                ], $summary),
            ],
        ],
        'INVALID: indirect dependency' => [
            static::CONFIG_ALLOWED_PLUGIN | static::EXTRA_EXIT_ON_PATCH_FAILURE | static::REQUIRE_PACKAGE_INDIRECTLY,
            [
                ValidationResult::createError([
                    t('It must be a root dependency.'),
                ], $summary),
            ],
            [
                'package-manager-faq-composer-patches-not-a-root-dependency',
                NULL,
            ],
        ],
        'VALID: present' => [
            static::CONFIG_ALLOWED_PLUGIN | static::EXTRA_EXIT_ON_PATCH_FAILURE | static::REQUIRE_PACKAGE_FROM_ROOT,
            [],
        ],
        'VALID: absent' => [
            static::ABSENT,
            [],
        ],
    ];
}

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