function EntityDeriverTest::derivativesProvider

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Entity/EntityDeriverTest.php \Drupal\KernelTests\Core\Entity\EntityDeriverTest::derivativesProvider()
  2. 8.9.x core/tests/Drupal/KernelTests/Core/Entity/EntityDeriverTest.php \Drupal\KernelTests\Core\Entity\EntityDeriverTest::derivativesProvider()
  3. 10 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 73

Class

EntityDeriverTest
Tests EntityDeriver functionality.

Namespace

Drupal\KernelTests\Core\Entity

Code

public static function derivativesProvider() {
    return [
        'un-bundleable entity type with no bundle type' => [
            'entity:user',
            FALSE,
        ],
        'un-bundleable 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,
        ],
        'un-bundleable entity type with entity_test_entity_bundle_info()-generated bundle type' => [
            'entity:entity_test_no_bundle:foo',
            FALSE,
        ],
        'un-bundleable 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.