You are here

protected function MigrateRdfMappingTest::assertRdfMapping in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/rdf/tests/src/Kernel/Migrate/d7/MigrateRdfMappingTest.php \Drupal\Tests\rdf\Kernel\Migrate\d7\MigrateRdfMappingTest::assertRdfMapping()
  2. 10 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));
  }
}