summaryrefslogtreecommitdiff
path: root/modules/field/tests
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2012-11-05 21:43:53 -0500
committerDavid Rothstein <drothstein@gmail.com>2012-11-05 21:43:53 -0500
commit735adae7f3051b4e1701dd46fd11944f66fb5849 (patch)
treeb2c0c47e8ec1f63d73f5eb201281d01c3312160e /modules/field/tests
parent47d3d613892dd5eb5175941543cb666362915667 (diff)
downloadbrdo-735adae7f3051b4e1701dd46fd11944f66fb5849.tar.gz
brdo-735adae7f3051b4e1701dd46fd11944f66fb5849.tar.bz2
Issue #1812822 by larowlan, _wdm_: Fixed field_test_entity_info() does not set a 'label' on the Test Entity.
Diffstat (limited to 'modules/field/tests')
-rw-r--r--modules/field/tests/field.test5
-rw-r--r--modules/field/tests/field_test.entity.inc14
2 files changed, 11 insertions, 8 deletions
diff --git a/modules/field/tests/field.test b/modules/field/tests/field.test
index 739ddbe99..8004178eb 100644
--- a/modules/field/tests/field.test
+++ b/modules/field/tests/field.test
@@ -1119,8 +1119,11 @@ class FieldInfoTestCase extends FieldTestCase {
'test_setting' => 999)));
field_create_instance($instance);
+ $info = entity_get_info('test_entity');
$instances = field_info_instances('test_entity', $instance['bundle']);
- $this->assertEqual(count($instances), 1, t('One instance shows up in info when attached to a bundle.'));
+ $this->assertEqual(count($instances), 1, format_string('One instance shows up in info when attached to a bundle on a @label.', array(
+ '@label' => $info['label']
+ )));
$this->assertTrue($instance < $instances[$instance['field_name']], t('Instance appears in info correctly'));
// Test a valid entity type but an invalid bundle.
diff --git a/modules/field/tests/field_test.entity.inc b/modules/field/tests/field_test.entity.inc
index 52ed3fcd0..95af3eeba 100644
--- a/modules/field/tests/field_test.entity.inc
+++ b/modules/field/tests/field_test.entity.inc
@@ -23,7 +23,7 @@ function field_test_entity_info() {
return array(
'test_entity' => array(
- 'name' => t('Test Entity'),
+ 'label' => t('Test Entity'),
'fieldable' => TRUE,
'field cache' => FALSE,
'base table' => 'test_entity',
@@ -38,7 +38,7 @@ function field_test_entity_info() {
),
// This entity type doesn't get form handling for now...
'test_cacheable_entity' => array(
- 'name' => t('Test Entity, cacheable'),
+ 'label' => t('Test Entity, cacheable'),
'fieldable' => TRUE,
'field cache' => TRUE,
'entity keys' => array(
@@ -50,7 +50,7 @@ function field_test_entity_info() {
'view modes' => $test_entity_modes,
),
'test_entity_bundle_key' => array(
- 'name' => t('Test Entity with a bundle key.'),
+ 'label' => t('Test Entity with a bundle key.'),
'base table' => 'test_entity_bundle_key',
'fieldable' => TRUE,
'field cache' => FALSE,
@@ -63,7 +63,7 @@ function field_test_entity_info() {
),
// In this case, the bundle key is not stored in the database.
'test_entity_bundle' => array(
- 'name' => t('Test Entity with a specified bundle.'),
+ 'label' => t('Test Entity with a specified bundle.'),
'base table' => 'test_entity_bundle',
'fieldable' => TRUE,
'controller class' => 'TestEntityBundleController',
@@ -77,7 +77,7 @@ function field_test_entity_info() {
),
// @see EntityPropertiesTestCase::testEntityLabel()
'test_entity_no_label' => array(
- 'name' => t('Test entity without label'),
+ 'label' => t('Test entity without label'),
'fieldable' => TRUE,
'field cache' => FALSE,
'base table' => 'test_entity',
@@ -90,7 +90,7 @@ function field_test_entity_info() {
'view modes' => $test_entity_modes,
),
'test_entity_label' => array(
- 'name' => t('Test entity label'),
+ 'label' => t('Test entity label'),
'fieldable' => TRUE,
'field cache' => FALSE,
'base table' => 'test_entity',
@@ -104,7 +104,7 @@ function field_test_entity_info() {
'view modes' => $test_entity_modes,
),
'test_entity_label_callback' => array(
- 'name' => t('Test entity label callback'),
+ 'label' => t('Test entity label callback'),
'fieldable' => TRUE,
'field cache' => FALSE,
'base table' => 'test_entity',