function CrudTest::testBundleMapping
Same name in other branches
- 8.9.x core/modules/rdf/tests/src/Kernel/CrudTest.php \Drupal\Tests\rdf\Kernel\CrudTest::testBundleMapping()
Tests the handling of bundle mappings.
File
-
core/
modules/ rdf/ tests/ src/ Kernel/ CrudTest.php, line 62
Class
- CrudTest
- Tests the RDF mapping CRUD functions.
Namespace
Drupal\Tests\rdf\KernelCode
public function testBundleMapping() {
// Test that the bundle mapping can be saved.
$types = [
'sioc:Post',
'foaf:Document',
];
rdf_get_mapping($this->entityType, $this->bundle)
->setBundleMapping([
'types' => $types,
])
->save();
$bundle_mapping = rdf_get_mapping($this->entityType, $this->bundle)
->getBundleMapping();
$this->assertEquals($types, $bundle_mapping['types'], 'Bundle mapping saved.');
// Test that the bundle mapping can be edited.
$types = [
'schema:BlogPosting',
];
rdf_get_mapping($this->entityType, $this->bundle)
->setBundleMapping([
'types' => $types,
])
->save();
$bundle_mapping = rdf_get_mapping($this->entityType, $this->bundle)
->getBundleMapping();
$this->assertEquals($types, $bundle_mapping['types'], 'Bundle mapping updated.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.