function EntityDeriverTest::derivativesProvider

Same name and namespace in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Entity/EntityDeriverTest.php \Drupal\KernelTests\Core\Entity\EntityDeriverTest::derivativesProvider()
  2. 10 core/tests/Drupal/KernelTests/Core/Entity/EntityDeriverTest.php \Drupal\KernelTests\Core\Entity\EntityDeriverTest::derivativesProvider()
  3. 11.x 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,
        ],
    ];
}

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