You are here

public function EntityDeriverTest::derivativesProvider in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Entity/EntityDeriverTest.php \Drupal\KernelTests\Core\Entity\EntityDeriverTest::derivativesProvider()

Provides test data for ::testDerivatives().

File

core/tests/Drupal/KernelTests/Core/Entity/EntityDeriverTest.php, line 71

Class

EntityDeriverTest
Tests EntityDeriver functionality.

Namespace

Drupal\KernelTests\Core\Entity

Code

public function derivativesProvider() {
  return [
    'unbundleable entity type with no bundle type' => [
      'entity:user',
      FALSE,
    ],
    'unbundleable entity type with bundle type' => [
      'entity:user:user',
      TRUE,
    ],
    'bundleable entity type with no bundle type' => [
      'entity:node',
      FALSE,
    ],
    'bundleable entity type with bundle type' => [
      'entity:node:article',
      FALSE,
    ],
    'bundleable entity type with bundle type with matching name' => [
      'entity:comment:comment',
      FALSE,
    ],
    'unbundleable entity type with entity_test_entity_bundle_info()-generated bundle type' => [
      'entity:entity_test_no_bundle:foo',
      FALSE,
    ],
    'unbundleable entity type with entity_test_entity_bundle_info()-generated bundle type with matching name' => [
      'entity:entity_test_no_bundle:entity_test_no_bundle',
      FALSE,
    ],
  ];
}