本文整理汇总了PHP中entity_test_entity_types函数的典型用法代码示例。如果您正苦于以下问题:PHP entity_test_entity_types函数的具体用法?PHP entity_test_entity_types怎么用?PHP entity_test_entity_types使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了entity_test_entity_types函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: testDefaultValues
/**
* Tests default values on entities and fields.
*/
public function testDefaultValues()
{
// All entity variations have to have the same results.
foreach (entity_test_entity_types() as $entity_type) {
$this->assertDefaultValues($entity_type);
}
}
开发者ID:papillon-cendre,项目名称:d8,代码行数:10,代码来源:EntityFieldDefaultValueTest.php
示例2: testValidation
/**
* Tests validating test entity types.
*/
public function testValidation()
{
// All entity variations have to have the same results.
foreach (entity_test_entity_types() as $entity_type) {
$this->checkValidation($entity_type);
}
}
开发者ID:anatalsceo,项目名称:en-classe,代码行数:10,代码来源:EntityValidationTest.php
示例3: testRevisions
/**
* Check node revision related operations.
*/
public function testRevisions()
{
// All revisable entity variations have to have the same results.
foreach (entity_test_entity_types(ENTITY_TEST_TYPES_REVISABLE) as $entity_type) {
$this->runRevisionsTests($entity_type);
}
}
开发者ID:318io,项目名称:318-io,代码行数:10,代码来源:EntityRevisionsTest.php
示例4: testCRUD
/**
* Tests basic CRUD functionality of the Entity API.
*/
public function testCRUD()
{
// All entity variations have to have the same results.
foreach (entity_test_entity_types() as $entity_type) {
$this->assertCRUD($entity_type, $this->createUser());
}
}
开发者ID:sgtsaughter,项目名称:d8portfolio,代码行数:10,代码来源:EntityApiTest.php
示例5: setUp
protected function setUp()
{
parent::setUp();
$this->languageManager = $this->container->get('language_manager');
$this->installEntitySchema('entity_test_rev');
$this->installEntitySchema('entity_test_mul');
$this->installEntitySchema('entity_test_mulrev');
$this->installConfig(array('language'));
// Create the test field.
entity_test_install();
// Enable translations for the test entity type.
$this->state->set('entity_test.translation', TRUE);
// Create a translatable test field.
$this->field_name = drupal_strtolower($this->randomMachineName() . '_field_name');
// Create an untranslatable test field.
$this->untranslatable_field_name = drupal_strtolower($this->randomMachineName() . '_field_name');
// Create field fields in all entity variations.
foreach (entity_test_entity_types() as $entity_type) {
entity_create('field_storage_config', array('field_name' => $this->field_name, 'entity_type' => $entity_type, 'type' => 'text', 'cardinality' => 4))->save();
entity_create('field_config', array('field_name' => $this->field_name, 'entity_type' => $entity_type, 'bundle' => $entity_type, 'translatable' => TRUE))->save();
$this->field[$entity_type] = entity_load('field_config', $entity_type . '.' . $entity_type . '.' . $this->field_name);
entity_create('field_storage_config', array('field_name' => $this->untranslatable_field_name, 'entity_type' => $entity_type, 'type' => 'text', 'cardinality' => 4))->save();
entity_create('field_config', array('field_name' => $this->untranslatable_field_name, 'entity_type' => $entity_type, 'bundle' => $entity_type, 'translatable' => FALSE))->save();
}
// Create the default languages.
$this->installConfig(array('language'));
// Create test languages.
$this->langcodes = array();
for ($i = 0; $i < 3; ++$i) {
$language = ConfigurableLanguage::create(array('id' => 'l' . $i, 'label' => $this->randomString(), 'weight' => $i));
$this->langcodes[$i] = $language->getId();
$language->save();
}
}
开发者ID:davidsoloman,项目名称:drupalconsole.com,代码行数:34,代码来源:EntityLanguageTestBase.php
示例6: testFormCRUD
/**
* Tests basic form CRUD functionality.
*/
function testFormCRUD()
{
// All entity variations have to have the same results.
foreach (entity_test_entity_types() as $entity_type) {
$this->doTestFormCRUD($entity_type);
}
}
开发者ID:Nikola-xiii,项目名称:d8intranet,代码行数:10,代码来源:EntityFormTest.php
示例7: testMultilingualFormCRUD
/**
* Tests basic multilingual form CRUD functionality.
*/
public function testMultilingualFormCRUD()
{
// All entity variations have to have the same results.
foreach (entity_test_entity_types(ENTITY_TEST_TYPES_MULTILINGUAL) as $entity_type) {
$this->doTestMultilingualFormCRUD($entity_type);
}
}
开发者ID:HakS,项目名称:drupal8_training,代码行数:10,代码来源:EntityFormTest.php
示例8: routes
/**
* Returns an array of route objects.
*
* @return \Symfony\Component\Routing\Route[]
* An array of route objects.
*/
public function routes()
{
$types = entity_test_entity_types(ENTITY_TEST_TYPES_ROUTING);
$routes = array();
foreach ($types as $entity_type_id) {
$routes["entity.{$entity_type_id}.admin_form"] = new Route("{$entity_type_id}/structure/{bundle}", array('_controller' => '\\Drupal\\entity_test\\Controller\\EntityTestController::testAdmin'), array('_permission' => 'administer entity_test content'), array('_admin_route' => TRUE));
}
return $routes;
}
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:15,代码来源:EntityTestRoutes.php
示例9: getDerivativeDefinitions
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition)
{
$this->derivatives = array();
$types = entity_test_entity_types();
foreach ($types as $entity_type) {
$this->derivatives[$entity_type] = array();
$this->derivatives[$entity_type]['base_route'] = "entity_test.edit_{$entity_type}";
$this->derivatives[$entity_type]['route_name'] = "entity_test.edit_{$entity_type}";
$this->derivatives[$entity_type]['title'] = 'Edit';
}
return parent::getDerivativeDefinitions($base_plugin_definition);
}
开发者ID:anatalsceo,项目名称:en-classe,代码行数:15,代码来源:EntityTestLocalTasks.php
示例10: routes
/**
* Returns an array of route objects.
*
* @return \Symfony\Component\Routing\Route[]
* An array of route objects.
*/
public function routes()
{
$types = entity_test_entity_types();
$types[] = 'entity_test_string_id';
$types[] = 'entity_test_no_id';
$routes = array();
foreach ($types as $entity_type) {
$routes["entity_test.add_{$entity_type}"] = new Route("{$entity_type}/add", array('_content' => '\\Drupal\\entity_test\\Controller\\EntityTestController::testAdd', 'entity_type' => $entity_type), array('_permission' => 'administer entity_test content'));
$routes["entity_test.edit_{$entity_type}"] = new Route("{$entity_type}/manage/{" . $entity_type . '}', array('_content' => '\\Drupal\\entity_test\\Controller\\EntityTestController::testEdit', '_entity_type' => $entity_type), array('_permission' => 'administer entity_test content'), array('parameters' => array($entity_type => array('type' => 'entity:' . $entity_type))));
$routes["entity_test.admin_{$entity_type}"] = new Route("{$entity_type}/structure/{bundle}", array('_content' => '\\Drupal\\entity_test\\Controller\\EntityTestController::testAdmin'), array('_permission' => 'administer entity_test content'));
}
return $routes;
}
开发者ID:anatalsceo,项目名称:en-classe,代码行数:19,代码来源:EntityTestRoutes.php
示例11: routes
/**
* Returns an array of route objects.
*
* @return \Symfony\Component\Routing\Route[]
* An array of route objects.
*/
public function routes()
{
$types = entity_test_entity_types(ENTITY_TEST_TYPES_ROUTING);
$types[] = 'entity_test_string_id';
$types[] = 'entity_test_no_id';
$routes = array();
foreach ($types as $entity_type_id) {
$routes["entity.{$entity_type_id}.add_form"] = new Route("{$entity_type_id}/add", array('_controller' => '\\Drupal\\entity_test\\Controller\\EntityTestController::testAdd', 'entity_type_id' => $entity_type_id), array('_permission' => 'administer entity_test content'));
$routes["entity.{$entity_type_id}.canonical"] = new Route($entity_type_id . '/manage/{' . $entity_type_id . '}', array('_controller' => '\\Drupal\\entity_test\\Controller\\EntityTestController::testEdit', 'entity_type_id' => $entity_type_id), array('_permission' => 'administer entity_test content'), array('parameters' => array($entity_type_id => array('type' => 'entity:' . $entity_type_id))));
$routes["entity.{$entity_type_id}.edit_form"] = new Route($entity_type_id . '/manage/{' . $entity_type_id . '}', array('_controller' => '\\Drupal\\entity_test\\Controller\\EntityTestController::testEdit', 'entity_type_id' => $entity_type_id), array('_permission' => 'administer entity_test content'), array('parameters' => array($entity_type_id => array('type' => 'entity:' . $entity_type_id))));
$routes["entity.{$entity_type_id}.delete_form"] = new Route('entity_test/delete/' . $entity_type_id . '/{' . $entity_type_id . '}', array('_entity_form' => $entity_type_id . '.delete'), array('_permission' => 'administer entity_test content'));
$routes["entity.{$entity_type_id}.admin_form"] = new Route("{$entity_type_id}/structure/{bundle}", array('_controller' => '\\Drupal\\entity_test\\Controller\\EntityTestController::testAdmin'), array('_permission' => 'administer entity_test content'));
}
return $routes;
}
开发者ID:nstielau,项目名称:drops-8,代码行数:21,代码来源:EntityTestRoutes.php
示例12: getDerivativeDefinitions
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition)
{
$this->derivatives = array();
$types = entity_test_entity_types(ENTITY_TEST_TYPES_ROUTING);
foreach ($types as $entity_type) {
$this->derivatives[$entity_type . '.canonical'] = array();
$this->derivatives[$entity_type . '.canonical']['base_route'] = "entity.{$entity_type}.canonical";
$this->derivatives[$entity_type . '.canonical']['route_name'] = "entity.{$entity_type}.canonical";
$this->derivatives[$entity_type . '.canonical']['title'] = 'View';
$this->derivatives[$entity_type . '.edit'] = array();
$this->derivatives[$entity_type . '.edit']['base_route'] = "entity.{$entity_type}.canonical";
$this->derivatives[$entity_type . '.edit']['route_name'] = "entity.{$entity_type}.edit_form";
$this->derivatives[$entity_type . '.edit']['title'] = 'Edit';
}
return parent::getDerivativeDefinitions($base_plugin_definition);
}
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:19,代码来源:EntityTestLocalTasks.php
示例13: testValidation
/**
* Tests validating test entity types.
*/
public function testValidation()
{
// Ensure that the constraint manager is marked as cached cleared.
$plugin_cache_clearer = \Drupal::service('plugin.cache_clearer');
$get_cached_discoveries = function () {
return $this->cachedDiscoveries;
};
$get_cached_discoveries = $get_cached_discoveries->bindTo($plugin_cache_clearer, $plugin_cache_clearer);
$cached_discoveries = $get_cached_discoveries();
$cached_discovery_classes = [];
foreach ($cached_discoveries as $cached_discovery) {
$cached_discovery_classes[] = get_class($cached_discovery);
}
$this->assertTrue(in_array('Drupal\\Core\\Validation\\ConstraintManager', $cached_discovery_classes));
// All entity variations have to have the same results.
foreach (entity_test_entity_types() as $entity_type) {
$this->checkValidation($entity_type);
}
}
开发者ID:Nikola-xiii,项目名称:d8intranet,代码行数:22,代码来源:EntityValidationTest.php
示例14: setUp
protected function setUp()
{
parent::setUp();
$this->languageManager = $this->container->get('language_manager');
foreach (entity_test_entity_types() as $entity_type_id) {
// The entity_test schema is installed by the parent.
if ($entity_type_id != 'entity_test') {
$this->installEntitySchema($entity_type_id);
}
}
$this->installConfig(array('language'));
// Create the test field.
module_load_install('entity_test');
entity_test_install();
// Enable translations for the test entity type.
$this->state->set('entity_test.translation', TRUE);
// Create a translatable test field.
$this->fieldName = Unicode::strtolower($this->randomMachineName() . '_field_name');
// Create an untranslatable test field.
$this->untranslatableFieldName = Unicode::strtolower($this->randomMachineName() . '_field_name');
// Create field fields in all entity variations.
foreach (entity_test_entity_types() as $entity_type) {
FieldStorageConfig::create(array('field_name' => $this->fieldName, 'entity_type' => $entity_type, 'type' => 'text', 'cardinality' => 4))->save();
FieldConfig::create(['field_name' => $this->fieldName, 'entity_type' => $entity_type, 'bundle' => $entity_type, 'translatable' => TRUE])->save();
FieldStorageConfig::create(array('field_name' => $this->untranslatableFieldName, 'entity_type' => $entity_type, 'type' => 'text', 'cardinality' => 4))->save();
FieldConfig::create(['field_name' => $this->untranslatableFieldName, 'entity_type' => $entity_type, 'bundle' => $entity_type, 'translatable' => FALSE])->save();
}
// Create the default languages.
$this->installConfig(array('language'));
// Create test languages.
$this->langcodes = array();
for ($i = 0; $i < 3; ++$i) {
$language = ConfigurableLanguage::create(array('id' => 'l' . $i, 'label' => $this->randomString(), 'weight' => $i));
$this->langcodes[$i] = $language->getId();
$language->save();
}
}
开发者ID:sojo,项目名称:d8_friendsofsilence,代码行数:37,代码来源:EntityLanguageTestBase.php
示例15: testMultilingualProperties
/**
* Tests multilingual properties.
*/
public function testMultilingualProperties()
{
// Test all entity variations with data table support.
foreach (entity_test_entity_types(ENTITY_TEST_TYPES_MULTILINGUAL) as $entity_type) {
$this->_testMultilingualProperties($entity_type);
}
}
开发者ID:anatalsceo,项目名称:en-classe,代码行数:10,代码来源:EntityTranslationTest.php
示例16: testLanguageChange
/**
* Tests that changing entity language does not break field language.
*/
public function testLanguageChange()
{
// Test all entity variations with data table support.
foreach (entity_test_entity_types(ENTITY_TEST_TYPES_MULTILINGUAL) as $entity_type) {
$this->doTestLanguageChange($entity_type);
}
}
开发者ID:dmyerson,项目名称:d8ecs,代码行数:10,代码来源:EntityTranslationTest.php
示例17: testValidation
/**
* Tests validating test entity types.
*/
public function testValidation()
{
// Ensure that the constraint manager is marked as cached cleared.
// Use the protected property on the cache_clearer first to check whether
// the constraint manager is added there.
// Ensure that the proxy class is initialized, which has the necessary
// method calls attached.
\Drupal::service('plugin.cache_clearer');
$plugin_cache_clearer = \Drupal::service('drupal.proxy_original_service.plugin.cache_clearer');
$get_cached_discoveries = function () {
return $this->cachedDiscoveries;
};
$get_cached_discoveries = $get_cached_discoveries->bindTo($plugin_cache_clearer, $plugin_cache_clearer);
$cached_discoveries = $get_cached_discoveries();
$cached_discovery_classes = [];
foreach ($cached_discoveries as $cached_discovery) {
$cached_discovery_classes[] = get_class($cached_discovery);
}
$this->assertTrue(in_array('Drupal\\Core\\Validation\\ConstraintManager', $cached_discovery_classes));
// All entity variations have to have the same results.
foreach (entity_test_entity_types() as $entity_type) {
$this->checkValidation($entity_type);
}
}
开发者ID:aWEBoLabs,项目名称:taxi,代码行数:27,代码来源:EntityValidationTest.php
示例18: testComputedProperties
/**
* Tests getting processed property values via a computed property.
*/
public function testComputedProperties()
{
// All entity variations have to have the same results.
foreach (entity_test_entity_types() as $entity_type) {
$this->assertComputedProperties($entity_type);
}
}
开发者ID:davidsoloman,项目名称:drupalconsole.com,代码行数:10,代码来源:EntityFieldTest.php
注:本文中的entity_test_entity_types函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论