function NodeAttributesTest::setUp

Same name in other branches
  1. 9 core/modules/rdf/tests/src/Functional/NodeAttributesTest.php \Drupal\Tests\rdf\Functional\NodeAttributesTest::setUp()

Overrides NodeTestBase::setUp

File

core/modules/rdf/tests/src/Functional/NodeAttributesTest.php, line 37

Class

NodeAttributesTest
Tests the RDFa markup of Nodes.

Namespace

Drupal\Tests\rdf\Functional

Code

protected function setUp() {
    parent::setUp();
    rdf_get_mapping('node', 'article')->setBundleMapping([
        'types' => [
            'sioc:Item',
            'foaf:Document',
        ],
    ])
        ->setFieldMapping('title', [
        'properties' => [
            'dc:title',
        ],
    ])
        ->setFieldMapping('created', [
        'properties' => [
            'dc:date',
            'dc:created',
        ],
        'datatype' => 'xsd:dateTime',
        'datatype_callback' => [
            'callable' => 'Drupal\\rdf\\CommonDataConverter::dateIso8601Value',
        ],
    ])
        ->save();
    // Prepares commonly used URIs.
    $this->baseUri = Url::fromRoute('<front>', [], [
        'absolute' => TRUE,
    ])->toString();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.