You are here

protected function EntityResolverTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/serialization/src/Tests/EntityResolverTest.php \Drupal\serialization\Tests\EntityResolverTest::setUp()

Overrides NormalizerTestBase::setUp

File

core/modules/serialization/src/Tests/EntityResolverTest.php, line 32
Contains \Drupal\serialization\Tests\EntityResolverTest.

Class

EntityResolverTest
Tests that entities references can be resolved.

Namespace

Drupal\serialization\Tests

Code

protected function setUp() {
  parent::setUp();
  \Drupal::service('router.builder')
    ->rebuild();

  // Create the test field storage.
  entity_create('field_storage_config', array(
    'entity_type' => 'entity_test_mulrev',
    'field_name' => 'field_test_entity_reference',
    'type' => 'entity_reference',
    'settings' => array(
      'target_type' => 'entity_test_mulrev',
    ),
  ))
    ->save();

  // Create the test field.
  entity_create('field_config', array(
    'entity_type' => 'entity_test_mulrev',
    'field_name' => 'field_test_entity_reference',
    'bundle' => 'entity_test_mulrev',
  ))
    ->save();
}