You are here

protected function MigrateRdfMappingTest::assertRdfMapping in Drupal 10

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. 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.

@internal

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 56

Class

MigrateRdfMappingTest
Tests RDF mappings migration from Drupal 7 to 8.

Namespace

Drupal\Tests\rdf\Kernel\Migrate\d7

Code

protected function assertRdfMapping(string $entity_type, string $bundle, array $types, array $field_mappings) : void {
  $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));
  }
}