$this->assertRaw(t('These settings apply to the %label field everywhere it is used.',array('%label'=>$label)),t('Field settings page was displayed.'));
$this->assertRaw(t('These settings apply to the %label field everywhere it is used.',array('%label'=>$label)),'Field settings page was displayed.');
// Second step : 'Field settings' form.
$this->drupalPost(NULL,$field_edit,t('Save field settings'));
$this->assertRaw(t('Updated field %label field settings.',array('%label'=>$label)),t('Redirected to instance and widget settings page.'));
$this->assertRaw(t('Updated field %label field settings.',array('%label'=>$label)),'Redirected to instance and widget settings page.');
$this->assertRaw(t('Are you sure you want to delete the field %label',array('%label'=>$label)),t('Delete confirmation was found.'));
$this->assertRaw(t('Are you sure you want to delete the field %label',array('%label'=>$label)),'Delete confirmation was found.');
// Submit confirmation form.
$this->drupalPost(NULL,array(),t('Delete'));
$this->assertRaw(t('The field %label has been deleted from the %type content type.',array('%label'=>$label,'%type'=>$bundle_label)),t('Delete message was found.'));
$this->assertRaw(t('The field %label has been deleted from the %type content type.',array('%label'=>$label,'%type'=>$bundle_label)),'Delete message was found.');
// Check that the field does not appear in the overview form.
$this->assertNoFieldByXPath('//table[@id="field-overview"]//span[@class="label-field"]',$label,t('Field does not appear in the overview page.'));
$this->assertNoFieldByXPath('//table[@id="field-overview"]//span[@class="label-field"]',$label,'Field does not appear in the overview page.');
@@ -124,8 +124,8 @@ function testViewModeCustom() {
// Check that the field is displayed with the default formatter in 'rss'
// mode (uses 'default'), and hidden in 'teaser' mode (uses custom settings).
$this->assertNodeViewText($node,'rss',$output['field_test_default'],t("The field is displayed as expected in view modes that use 'default' settings."));
$this->assertNodeViewNoText($node,'teaser',$value,t("The field is hidden in view modes that use custom settings."));
$this->assertNodeViewText($node,'rss',$output['field_test_default'],"The field is displayed as expected in view modes that use 'default' settings.");
$this->assertNodeViewNoText($node,'teaser',$value,"The field is hidden in view modes that use custom settings.");
// Change fomatter for 'default' mode, check that the field is displayed
// accordingly in 'rss' mode.
...
...
@@ -133,14 +133,14 @@ function testViewModeCustom() {
$this->assertNodeViewText($node,'rss',$output['field_test_with_prepare_view'],t("The field is displayed as expected in view modes that use 'default' settings."));
$this->assertNodeViewText($node,'rss',$output['field_test_with_prepare_view'],"The field is displayed as expected in view modes that use 'default' settings.");
// Specialize the 'rss' mode, check that the field is displayed the same.
$this->assertNodeViewText($node,'rss',$output['field_test_with_prepare_view'],t("The field is displayed as expected in newly specialized 'rss' mode."));
$this->assertNodeViewText($node,'rss',$output['field_test_with_prepare_view'],"The field is displayed as expected in newly specialized 'rss' mode.");
// Set the field to 'hidden' in the view mode, check that the field is
// hidden.
...
...
@@ -148,7 +148,7 @@ function testViewModeCustom() {
$this->assertNodeViewText($node,'rss',$output['field_test_with_prepare_view'],t("The field is displayed as expected when 'rss' mode is set back to 'default' settings."));
$this->assertNodeViewText($node,'rss',$output['field_test_with_prepare_view'],"The field is displayed as expected when 'rss' mode is set back to 'default' settings.");
// Specialize the view mode again.
$edit=array(
...
...
@@ -164,7 +164,7 @@ function testViewModeCustom() {
$this->assertTrue($this->xpath('//select[@name="fields[_add_existing_field][field_name]"]//option[@value="'.$this->field_name.'"]'),t('Existing field was found in account settings.'));
$this->assertTrue($this->xpath('//select[@name="fields[_add_existing_field][field_name]"]//option[@value="'.$this->field_name.'"]'),'Existing field was found in account settings.');
$this->assertRaw(t('Re-use existing field'),t('"Re-use existing field" was found.'));
$this->assertRaw(t('Re-use existing field'),'"Re-use existing field" was found.');
// Check that the list of options respects entity type restrictions on
// fields. The 'comment' field is restricted to the 'comment' entity type
// and should not appear in the list.
$this->assertFalse($this->xpath('//select[@id="edit-add-existing-field-field-name"]//option[@value="comment"]'),t('The list of options respects entity type restrictions.'));
$this->assertFalse($this->xpath('//select[@id="edit-add-existing-field-field-name"]//option[@value="comment"]'),'The list of options respects entity type restrictions.');
// Add a new field based on an existing field.
$edit=array(
...
...
@@ -175,12 +175,12 @@ function assertFieldSettings($bundle, $field_name, $string = 'dummy test string'
_field_info_collate_fields_reset();
// Assert field settings.
$field=field_info_field($field_name);
$this->assertTrue($field['settings']['test_field_setting']==$string,t('Field settings were found.'));
$this->assertTrue($field['settings']['test_field_setting']==$string,'Field settings were found.');
$this->assertNull(field_info_instance('node',$this->field_name,$type_name2),t('Field instance was deleted.'));
$this->assertNull(field_info_instance('node',$this->field_name,$type_name2),'Field instance was deleted.');
// Check that the field was deleted too.
$this->assertNull(field_info_field($this->field_name),t('Field was deleted.'));
$this->assertNull(field_info_field($this->field_name),'Field was deleted.');
}
/**
...
...
@@ -287,7 +287,7 @@ function testHiddenFields() {
// Check that the field type is not available in the 'add new field' row.
$this->drupalGet($bundle_path);
$this->assertFalse($this->xpath('//select[@id="edit-add-new-field-type"]//option[@value="hidden_test_field"]'),t("The 'add new field' select respects field types 'no_ui' property."));
$this->assertFalse($this->xpath('//select[@id="edit-add-new-field-type"]//option[@value="hidden_test_field"]'),"The 'add new field' select respects field types 'no_ui' property.");
// Create a field and an instance programmatically.
$field_name='hidden_test_field';
...
...
@@ -300,18 +300,18 @@ function testHiddenFields() {
'widget'=>array('type'=>'test_field_widget'),
);
field_create_instance($instance);
$this->assertTrue(field_read_instance('node',$field_name,$this->type),t('An instance of the field %field was created programmatically.',array('%field'=>$field_name)));
$this->assertTrue(field_read_instance('node',$field_name,$this->type),format_string('An instance of the field %field was created programmatically.',array('%field'=>$field_name)));
// Check that the newly added instance appears on the 'Manage Fields'
// screen.
$this->drupalGet($bundle_path);
$this->assertFieldByXPath('//table[@id="field-overview"]//td[1]',$instance['label'],t('Field was created and appears in the overview page.'));
$this->assertFieldByXPath('//table[@id="field-overview"]//td[1]',$instance['label'],'Field was created and appears in the overview page.');
// Check that the instance does not appear in the 're-use existing field' row