function InfoParserUnitTest::providerInfoException

Same name in other branches
  1. 11.x core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php \Drupal\Tests\Core\Extension\InfoParserUnitTest::providerInfoException()

Data provider for testInfoException().

File

core/tests/Drupal/Tests/Core/Extension/InfoParserUnitTest.php, line 92

Class

InfoParserUnitTest
Tests InfoParser class and exception.

Namespace

Drupal\Tests\Core\Extension

Code

public static function providerInfoException() : array {
    return [
        'missing required key, type' => [
            <<<YML
name: File
description: Missing key
package: Core
version: VERSION
dependencies:
  - field
YML
,
            "Missing required keys (type) in",
        ],
        'missing core_version_requirement' => [
            <<<YML
version: VERSION
type: module
name: Skynet
dependencies:
  - self_awareness
YML
,
            "The 'core_version_requirement' key must be present in",
        ],
        'missing two required keys' => [
            <<<YML
package: Core
version: VERSION
dependencies:
  - field
YML
,
            'Missing required keys (type, name) in',
        ],
    ];
}

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