You are here

protected function EntityReferenceRelationshipTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/field/src/Tests/EntityReference/Views/EntityReferenceRelationshipTest.php \Drupal\field\Tests\EntityReference\Views\EntityReferenceRelationshipTest::setUp()

Parameters

bool $import_test_views: Should the views specififed on the test class be imported. If you need to setup some additional stuff, like fields, you need to call false and then call createTestViews for your own.

Overrides ViewKernelTestBase::setUp

File

core/modules/field/src/Tests/EntityReference/Views/EntityReferenceRelationshipTest.php, line 57
Contains \Drupal\field\Tests\EntityReference\Views\EntityReferenceRelationshipTest.

Class

EntityReferenceRelationshipTest
Tests entity reference relationship data.

Namespace

Drupal\field\Tests\EntityReference\Views

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installEntitySchema('user');
  $this
    ->installEntitySchema('entity_test');
  $this
    ->installEntitySchema('entity_test_mul');

  // Create reference from entity_test to entity_test_mul.
  $this
    ->createEntityReferenceField('entity_test', 'entity_test', 'field_test_data', 'field_test_data', 'entity_test_mul');

  // Create reference from entity_test_mul to entity_test.
  $this
    ->createEntityReferenceField('entity_test_mul', 'entity_test_mul', 'field_data_test', 'field_data_test', 'entity_test');
  ViewTestData::createTestViews(get_class($this), array(
    'entity_reference_test_views',
  ));
}