function EntityReferenceSettingsTest::setUp

Same name in other branches
  1. 9 core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceSettingsTest.php \Drupal\Tests\field\Kernel\EntityReference\EntityReferenceSettingsTest::setUp()
  2. 10 core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceSettingsTest.php \Drupal\Tests\field\Kernel\EntityReference\EntityReferenceSettingsTest::setUp()
  3. 11.x core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceSettingsTest.php \Drupal\Tests\field\Kernel\EntityReference\EntityReferenceSettingsTest::setUp()

Overrides KernelTestBase::setUp

File

core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceSettingsTest.php, line 68

Class

EntityReferenceSettingsTest
Tests entity reference field settings.

Namespace

Drupal\Tests\field\Kernel\EntityReference

Code

protected function setUp() {
    parent::setup();
    $this->installEntitySchema('node');
    $this->installEntitySchema('taxonomy_term');
    $this->installEntitySchema('entity_test');
    $this->nodeType = NodeType::create([
        'type' => mb_strtolower($this->randomMachineName()),
        'name' => $this->randomString(),
    ]);
    $this->nodeType
        ->save();
    // Create a custom bundle.
    $this->customBundle = 'test_bundle_' . mb_strtolower($this->randomMachineName());
    entity_test_create_bundle($this->customBundle, NULL, 'entity_test');
    // Prepare the logger for collecting the expected critical error.
    $this->container
        ->get($this->testLogServiceName)
        ->cleanLogs();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.