protected function NormalizerTestBase::setUp

Same name in this branch

Sets up Drupal unit test environment.

Overrides DrupalUnitTestBase::setUp

See also

DrupalUnitTestBase::$modules

DrupalUnitTestBase

2 calls to NormalizerTestBase::setUp()
EntityResolverTest::setUp in drupal/core/modules/serialization/lib/Drupal/serialization/Tests/EntityResolverTest.php
Sets up Drupal unit test environment.
EntitySerializationTest::setUp in drupal/core/modules/serialization/lib/Drupal/serialization/Tests/EntitySerializationTest.php
Sets up Drupal unit test environment.
2 methods override NormalizerTestBase::setUp()
EntityResolverTest::setUp in drupal/core/modules/serialization/lib/Drupal/serialization/Tests/EntityResolverTest.php
Sets up Drupal unit test environment.
EntitySerializationTest::setUp in drupal/core/modules/serialization/lib/Drupal/serialization/Tests/EntitySerializationTest.php
Sets up Drupal unit test environment.

File

drupal/core/modules/serialization/lib/Drupal/serialization/Tests/NormalizerTestBase.php, line 21

Class

NormalizerTestBase

Namespace

Drupal\serialization\Tests

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installSchema('entity_test', array(
    'entity_test_mulrev',
    'entity_test_mulrev_property_revision',
    'entity_test_mulrev_property_data',
  ));
  $this
    ->installSchema('system', array(
    'url_alias',
  ));
  $this
    ->installConfig(array(
    'field',
  ));

  // Auto-create a field for testing.
  field_create_field(array(
    'field_name' => 'field_test_text',
    'type' => 'text',
    'cardinality' => 1,
    'translatable' => FALSE,
  ));
  $instance = array(
    'entity_type' => 'entity_test_mulrev',
    'field_name' => 'field_test_text',
    'bundle' => 'entity_test_mulrev',
    'label' => 'Test text-field',
    'widget' => array(
      'type' => 'text_textfield',
      'weight' => 0,
    ),
  );
  field_create_instance($instance);
}