You are here

protected function MicrodataReferenceFieldsTestCase::getMapping in Microdata 7

Implements MicrodataFieldTestCase::getMapping().

Overrides MicrodataFieldTestCase::getMapping

1 call to MicrodataReferenceFieldsTestCase::getMapping()
MicrodataReferenceFieldsTestCase::testAttributesInMarkup in ./microdata.test
Tests the placement of attributes in field markup.

File

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

Class

MicrodataReferenceFieldsTestCase
Test Field Collection microdata placement.

Code

protected function getMapping() {
  $mapping = array(
    $this->entityType => array(
      $this->bundleType => array(
        // Field collection field.
        $this->fieldcollectionFieldName => array(
          '#itemprop' => array(
            'nutrition',
          ),
        ),
        // Field group field.
        $this->fieldgroupFieldName => array(),
      ),
    ),
    'field_collection_item' => array(
      $this->fieldcollectionFieldName => array(
        '#itemtype' => array(
          'http://schema.org/NutritionInformation',
        ),
        $this->fieldcollectionSubfieldName => array(
          '#itemprop' => array(
            'calories',
          ),
        ),
      ),
      $this->fieldgroupFieldName => array(
        // This shouldn't be added to the HTML.
        '#itemtype' => array(
          'http://schema.org/DoNotPrint',
        ),
        '#is_item' => FALSE,
        $this->fieldgroupSubfieldName => array(
          '#itemprop' => array(
            'fieldproperty',
          ),
        ),
      ),
    ),
  );
  return $mapping;
}