function ConfigDependenciesTest::providerBasicDependencies

Same name and namespace in other branches
  1. 9 core/modules/rest/tests/src/Kernel/Entity/ConfigDependenciesTest.php \Drupal\Tests\rest\Kernel\Entity\ConfigDependenciesTest::providerBasicDependencies()
  2. 9 core/modules/hal/tests/src/Kernel/rest/Entity/ConfigDependenciesTest.php \Drupal\Tests\hal\Kernel\rest\Entity\ConfigDependenciesTest::providerBasicDependencies()
  3. 8.9.x core/modules/rest/tests/src/Kernel/Entity/ConfigDependenciesTest.php \Drupal\Tests\rest\Kernel\Entity\ConfigDependenciesTest::providerBasicDependencies()
  4. 10 core/modules/rest/tests/src/Kernel/Entity/ConfigDependenciesTest.php \Drupal\Tests\rest\Kernel\Entity\ConfigDependenciesTest::providerBasicDependencies()

Return value

array An array with numerical keys: 0. The original REST resource configuration.

File

core/modules/rest/tests/src/Kernel/Entity/ConfigDependenciesTest.php, line 61

Class

ConfigDependenciesTest
@coversDefaultClass <a href="/api/drupal/core%21modules%21rest%21src%21Entity%21ConfigDependencies.php/class/ConfigDependencies/11.x" title="Calculates rest resource config dependencies." class="local">\Drupal\rest\Entity\ConfigDependencies</a>

Namespace

Drupal\Tests\rest\Kernel\Entity

Code

public static function providerBasicDependencies() {
    return [
        'method' => [
            [
                'plugin_id' => 'entity:entity_test',
                'granularity' => RestResourceConfigInterface::METHOD_GRANULARITY,
                'configuration' => [
                    'GET' => [
                        'supported_auth' => [
                            'basic_auth',
                        ],
                        'supported_formats' => [
                            'json',
                        ],
                    ],
                    'POST' => [
                        'supported_auth' => [
                            'cookie',
                        ],
                        'supported_formats' => [
                            'xml',
                        ],
                    ],
                ],
            ],
        ],
        'resource' => [
            [
                'plugin_id' => 'entity:entity_test',
                'granularity' => RestResourceConfigInterface::RESOURCE_GRANULARITY,
                'configuration' => [
                    'methods' => [
                        'GET',
                        'POST',
                    ],
                    'formats' => [
                        'json',
                    ],
                    'authentication' => [
                        'cookie',
                        'basic_auth',
                    ],
                ],
            ],
        ],
    ];
}

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