You are here

protected function DimensionsItemTest::setUp in Physical Fields 8

Overrides EntityKernelTestBase::setUp

File

tests/src/Kernel/DimensionsItemTest.php, line 30

Class

DimensionsItemTest
Tests the 'physical_dimensions' field type.

Namespace

Drupal\Tests\physical\Kernel

Code

protected function setUp() {
  parent::setUp();
  $factory = PhpUnitComparatorFactory::getInstance();
  $factory
    ->register(new MeasurementComparator());
  $field_storage = FieldStorageConfig::create([
    'field_name' => 'test_dimensions',
    'entity_type' => 'entity_test',
    'type' => 'physical_dimensions',
  ]);
  $field_storage
    ->save();
  $field = FieldConfig::create([
    'field_name' => 'test_dimensions',
    'entity_type' => 'entity_test',
    'bundle' => 'entity_test',
  ]);
  $field
    ->save();
}