function entity_test_entity_types

Returns a list of test entity types.

The returned entity types are one for each available entity storage type:

  • The plain entity_test type supports neither revisions nor multilingual properties.
  • The entity_test_mul type supports multilingual properties.
  • The entity_test_rev type supports revisions.
  • The entity_test_mulrev type supports both revisions and multilingual properties.

Parameters

int $filter: Either ENTITY_TEST_TYPES_REVISABLE to only return revisable entity types or ENTITY_TEST_TYPES_MULTILINGUAL to only return multilingual ones. Defaults to NULL, which returns all.

Return value

array List with entity_types.

16 calls to entity_test_entity_types()
EntityApiTest::testCRUD in drupal/core/modules/system/lib/Drupal/system/Tests/Entity/EntityApiTest.php
Tests basic CRUD functionality of the Entity API.
EntityFieldTest::testComputedProperties in drupal/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldTest.php
Tests getting processed property values via a computed property.
EntityFieldTest::testDataStructureInterfaces in drupal/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldTest.php
Tests working with the entity based upon the TypedData API.
EntityFieldTest::testIntrospection in drupal/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldTest.php
Tests introspection and getting metadata upfront.
EntityFieldTest::testIterator in drupal/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldTest.php
Tests iterating over properties.

... See full list

File

drupal/core/modules/system/tests/modules/entity_test/entity_test.module, line 40
Test module for the entity API providing several entity types for testing.

Code

function entity_test_entity_types($filter = NULL) {
  $types = array();
  if ($filter == NULL) {
    $types[] = 'entity_test';
  }
  if ($filter != ENTITY_TEST_TYPES_REVISABLE) {
    $types[] = 'entity_test_mul';
  }
  if ($filter != ENTITY_TEST_TYPES_MULTILINGUAL) {
    $types[] = 'entity_test_rev';
  }
  $types[] = 'entity_test_mulrev';
  return drupal_map_assoc($types);
}