function MigrateRdfMappingTest::assertRdfMapping

Same name in other branches
  1. 9 core/modules/rdf/tests/src/Kernel/Migrate/d7/MigrateRdfMappingTest.php \Drupal\Tests\rdf\Kernel\Migrate\d7\MigrateRdfMappingTest::assertRdfMapping()

Asserts various aspects of a RDF mapping.

Parameters

string $entity_type: The entity type.

string $bundle: The bundle.

string[] $types: The expected RDF types.

array[] $field_mappings: The expected RDF field mappings.

1 call to MigrateRdfMappingTest::assertRdfMapping()
MigrateRdfMappingTest::testRdfMappingMigration in core/modules/rdf/tests/src/Kernel/Migrate/d7/MigrateRdfMappingTest.php
Tests RDF mappings migration from Drupal 7 to 8.

File

core/modules/rdf/tests/src/Kernel/Migrate/d7/MigrateRdfMappingTest.php, line 53

Class

MigrateRdfMappingTest
Tests RDF mappings migration from Drupal 7 to 8.

Namespace

Drupal\Tests\rdf\Kernel\Migrate\d7

Code

protected function assertRdfMapping($entity_type, $bundle, $types, $field_mappings) {
    $rdf_mapping = rdf_get_mapping($entity_type, $bundle);
    $this->assertInstanceOf(RdfMappingInterface::class, $rdf_mapping);
    $this->assertSame($types, $rdf_mapping->getBundleMapping());
    foreach ($field_mappings as $field => $mapping) {
        $this->assertSame($mapping, $rdf_mapping->getFieldMapping($field));
    }
}

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