You are here

protected function MicrodataCoreFieldsUITestCase::helperTestSingleFormField in Microdata 7

2 calls to MicrodataCoreFieldsUITestCase::helperTestSingleFormField()
MicrodataCoreFieldsUITestCase::subtestTaxonomyField in ./microdata.test
MicrodataCoreFieldsUITestCase::subtestTextField in ./microdata.test

File

./microdata.test, line 504
Tests for microdata.module.

Class

MicrodataCoreFieldsUITestCase

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.");
}