function entity_test_create_bundle

Same name in other branches
  1. 9 core/modules/system/tests/modules/entity_test/entity_test.module \entity_test_create_bundle()
  2. 8.9.x core/modules/system/tests/modules/entity_test/entity_test.module \entity_test_create_bundle()
  3. 10 core/modules/system/tests/modules/entity_test/entity_test.module \entity_test_create_bundle()

Creates a new bundle for entity_test entities.

Parameters

string $bundle: The machine-readable name of the bundle.

string $text: (optional) The human-readable name of the bundle. If none is provided, the machine name will be used.

string $entity_type: (optional) The entity type for which the bundle is created. Defaults to 'entity_test'.

Deprecated

in drupal:11.2.0 and is removed from drupal:12.0.0. Use \Drupal\entity_test\EntityTestHelper::createBundle() instead.

See also

https://www.drupal.org/node/3497049

File

core/modules/system/tests/modules/entity_test/entity_test.module, line 32

Code

function entity_test_create_bundle($bundle, $text = NULL, $entity_type = 'entity_test') {
    @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Use \\Drupal\\entity_test\\EntityTestHelper::createBundle() instead. See https://www.drupal.org/node/3497049', E_USER_DEPRECATED);
    EntityTestHelper::createBundle($bundle, $text, $entity_type);
}

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