function RelatedResourceTypesTest::setUp
Same name in other branches
- 9 core/modules/jsonapi/tests/src/Kernel/ResourceType/RelatedResourceTypesTest.php \Drupal\Tests\jsonapi\Kernel\ResourceType\RelatedResourceTypesTest::setUp()
- 8.9.x core/modules/jsonapi/tests/src/Kernel/ResourceType/RelatedResourceTypesTest.php \Drupal\Tests\jsonapi\Kernel\ResourceType\RelatedResourceTypesTest::setUp()
- 11.x core/modules/jsonapi/tests/src/Kernel/ResourceType/RelatedResourceTypesTest.php \Drupal\Tests\jsonapi\Kernel\ResourceType\RelatedResourceTypesTest::setUp()
Overrides KernelTestBase::setUp
File
-
core/
modules/ jsonapi/ tests/ src/ Kernel/ ResourceType/ RelatedResourceTypesTest.php, line 58
Class
- RelatedResourceTypesTest
- @coversDefaultClass \Drupal\jsonapi\ResourceType\ResourceType @coversClass \Drupal\jsonapi\ResourceType\ResourceTypeRepository @group jsonapi
Namespace
Drupal\Tests\jsonapi\Kernel\ResourceTypeCode
protected function setUp() : void {
parent::setUp();
// Add the entity schemas.
$this->installEntitySchema('node');
$this->installEntitySchema('user');
// Add the additional table schemas.
$this->installSchema('node', [
'node_access',
]);
$this->installSchema('user', [
'users_data',
]);
$this->installSchema('dblog', [
'watchdog',
]);
NodeType::create([
'type' => 'foo',
'name' => 'Foo',
])->save();
NodeType::create([
'type' => 'bar',
'name' => 'Bar',
])->save();
$this->createEntityReferenceField('node', 'foo', 'field_ref_bar', 'Bar Reference', 'node', 'default', [
'target_bundles' => [
'bar',
],
]);
$this->createEntityReferenceField('node', 'foo', 'field_ref_foo', 'Foo Reference', 'node', 'default', [
'target_bundles' => [
'foo',
],
]);
$this->createEntityReferenceField('node', 'foo', 'field_ref_any', 'Any Bundle Reference', 'node', 'default', [
'target_bundles' => NULL,
]);
$this->resourceTypeRepository = $this->container
->get('jsonapi.resource_type.repository');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.