You are here

protected function MachineNameItemTest::setUp in Machine name 8

Sets the test up.

Overrides FieldKernelTestBase::setUp

File

tests/src/Kernel/MachineNameItemTest.php, line 29

Class

MachineNameItemTest
Tests the new entity API for the machine_name field type.

Namespace

Drupal\Tests\machine_name\Kernel

Code

protected function setUp() {
  parent::setUp();

  // Create a machine_name field storage and field for validation.
  FieldStorageConfig::create(array(
    'field_name' => 'field_test',
    'entity_type' => 'entity_test',
    'type' => 'machine_name',
  ))
    ->save();
  FieldConfig::create([
    'entity_type' => 'entity_test',
    'field_name' => 'field_test',
    'bundle' => 'entity_test',
  ])
    ->save();
}