You are here

public function RequestTestBase::providerRequestTypes in OpenAPI 8.2

Dataprovider for testRequests.

File

tests/src/Functional/RequestTestBase.php, line 136

Class

RequestTestBase
Base tests for requests on OpenAPI routes.

Namespace

Drupal\Tests\openapi\Functional

Code

public function providerRequestTypes() {
  $data = [];
  foreach (static::$entityTestBundles as $entity_type => $bundles) {
    foreach ($bundles as $bundle) {
      $data[static::API_MODULE . ':' . $entity_type . '_' . $bundle] = [
        static::API_MODULE,
        [
          'entity_type_id' => $entity_type,
          'bundle_name' => $bundle,
        ],
      ];
    }

    // Test all bundles for entity type.
    $data[static::API_MODULE . ':' . $entity_type] = [
      static::API_MODULE,
      [
        'entity_type_id' => $entity_type,
      ],
    ];
  }

  // Test all entity types and bundle for module.
  $data[static::API_MODULE] = [
    static::API_MODULE,
  ];
  return $data;
}