You are here

protected function MicrodataCoreFieldsTestCase::getMapping in Microdata 7

Implements MicrodataFieldTestCase::getMapping().

Overrides MicrodataFieldTestCase::getMapping

2 calls to MicrodataCoreFieldsTestCase::getMapping()
MicrodataCoreFieldsMarkupTestCase::testAttributesInMarkup in ./microdata.test
Tests the placement of attributes in field markup.
MicrodataCoreFieldsUITestCase::testMicrodataUI in ./microdata.test
Tests the microdata UI for core fields.

File

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

Class

MicrodataCoreFieldsTestCase

Code

protected function getMapping() {
  $mapping = array(
    $this->entityType => array(
      $this->bundleType => array(
        '#itemtype' => array(
          'http://schema.org/BlogPosting',
        ),
        '#itemid_token' => '[node:url]',
        '#use_schema_url' => TRUE,
        // Title.
        'title' => array(
          '#itemprop' => array(
            'name',
          ),
        ),
        'body' => array(
          'value' => array(
            '#itemprop' => array(
              'articleBody',
            ),
          ),
          'summary' => array(
            '#itemprop' => array(
              'description',
            ),
          ),
        ),
        // Image field.
        $this->imageFieldName => array(
          '#itemprop' => array(
            'image',
          ),
        ),
        // Taxonomy Term Reference field.
        $this->taxFieldName => array(
          '#itemprop' => array(
            'about',
          ),
        ),
        // Text field.
        $this->textFieldName => array(
          '#itemprop' => array(
            'genre',
          ),
        ),
        // List field.
        $this->listFieldName => array(
          '#itemprop' => array(
            'ingredient',
          ),
        ),
        // Number field.
        $this->numberFieldName => array(
          '#itemprop' => array(
            'age',
          ),
        ),
        $this->keywordsFieldName => array(
          '#itemprop' => array(
            'keywords',
          ),
        ),
      ),
    ),
    'taxonomy_term' => array(
      'tags' => array(
        '#itemtype' => array(
          'http://schema.org/Thing',
        ),
        // Title.
        'title' => array(
          '#itemprop' => array(
            'name',
          ),
        ),
        'url' => array(
          '#itemprop' => array(
            'url',
          ),
        ),
      ),
      'keywords' => array(
        '#is_item' => FALSE,
      ),
    ),
  );
  return $mapping;
}