function FieldConfigValidationTest::setUp

Same name in other branches
  1. 11.x core/modules/field/tests/src/Kernel/Entity/FieldConfigValidationTest.php \Drupal\Tests\field\Kernel\Entity\FieldConfigValidationTest::setUp()

Overrides ConfigEntityValidationTestBase::setUp

File

core/modules/field/tests/src/Kernel/Entity/FieldConfigValidationTest.php, line 31

Class

FieldConfigValidationTest
Tests validation of field_config entities.

Namespace

Drupal\Tests\field\Kernel\Entity

Code

protected function setUp() : void {
    parent::setUp();
    $this->installConfig('node');
    $this->createContentType([
        'type' => 'one',
    ]);
    $this->createContentType([
        'type' => 'another',
    ]);
    EntityTestBundle::create([
        'id' => 'one',
    ])->save();
    EntityTestBundle::create([
        'id' => 'another',
    ])->save();
    $this->entity = FieldConfig::loadByName('node', 'one', 'body');
}

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