diff --git a/core/modules/field/lib/Drupal/field/Tests/FormTest.php b/core/modules/field/lib/Drupal/field/Tests/FormTest.php index 94919aa..79ffecf 100644 --- a/core/modules/field/lib/Drupal/field/Tests/FormTest.php +++ b/core/modules/field/lib/Drupal/field/Tests/FormTest.php @@ -30,7 +30,7 @@ class FormTest extends FieldTestBase { 'entity_type' => 'test_entity', 'bundle' => 'test_bundle', 'label' => $this->randomName() . '_label', - 'description' => $this->randomName() . '_description', + 'description' => '[date:short]_description', 'weight' => mt_rand(0, 127), 'settings' => array( 'test_instance_setting' => $this->randomName(), @@ -55,6 +55,10 @@ class FormTest extends FieldTestBase { // Display creation form. $this->drupalGet('test-entity/add/test_bundle'); + + // Create token value expected for description. + $token_description = format_date(time(), 'short') . '_description'; + $this->assertText($token_description, 'Token replacement for description is displayed'); $this->assertFieldByName("{$this->field_name}[$langcode][0][value]", '', 'Widget is displayed'); $this->assertNoField("{$this->field_name}[$langcode][1][value]", 'No extraneous widget is displayed'); // TODO : check that the widget is populated with default value ? diff --git a/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php b/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php index 2ae34d1..39a0e11 100644 --- a/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php +++ b/core/modules/image/lib/Drupal/image/Tests/ImageFieldDisplayTest.php @@ -133,13 +133,15 @@ class ImageFieldDisplayTest extends ImageFieldTestBase { $widget_settings = array( 'preview_image_style' => 'medium', ); - $field = $this->createImageField($field_name, 'article', array(), $instance_settings, $widget_settings); + $field = $this->createImageField($field_name, 'article', array('description' => '[date:short]_description',), $instance_settings, $widget_settings); $field['deleted'] = 0; $table = _field_sql_storage_tablename($field); $schema = drupal_get_schema($table, TRUE); $instance = field_info_instance('node', $field_name, 'article'); $this->drupalGet('node/add/article'); + $token_description = format_date(time(), 'short') . '_description'; + $this->assertText($token_description, 'Token replacement for description is displayed on article form.'); $this->assertText(t('Files must be less than 50 KB.'), t('Image widget max file size is displayed on article form.')); $this->assertText(t('Allowed file types: ' . $test_image_extension . '.'), t('Image widget allowed file types displayed on article form.')); $this->assertText(t('Images must be between 10x10 and 100x100 pixels.'), t('Image widget allowed resolution displayed on article form.'));