protected function MicrodataCoreFieldsUITestCase::helperTestSingleFormField in Microdata 7
2 calls to MicrodataCoreFieldsUITestCase::helperTestSingleFormField()
File
- ./
microdata.test, line 504 - Tests for microdata.module.
Class
Code
protected function helperTestSingleFormField($original_mapping, $field_name) {
$path = $this->field_admin . '/' . $field_name;
$formfield_name = "microdata[fields][{$field_name}][field][itemprop]";
$text_itemprop = $original_mapping[$field_name]['#itemprop'][0];
$new_itemprop = $this
->randomName();
$this
->drupalGet($path);
$this
->assertTrue($this
->xpath("//input[@name='{$formfield_name}' and @value='{$text_itemprop}']"), "Existing mapping value displayed for {$field_name} field.");
$edit = array(
$formfield_name => $new_itemprop,
);
$this
->drupalPost(NULL, $edit, t('Save settings'));
$this
->drupalGet($path);
$this
->assertTrue($this
->xpath("//input[@name='{$formfield_name}' and @value='{$new_itemprop}']"), "Changing {$field_name} itemprop via UI works.");
}