You are here

protected function RadioactivityValueFormatterTest::setUp in Radioactivity 4.0.x

Same name and namespace in other branches
  1. 8.3 tests/src/Kernel/RadioactivityValueFormatterTest.php \Drupal\Tests\radioactivity\Kernel\RadioactivityValueFormatterTest::setUp()

Set the default field storage backend for fields created during tests.

Overrides FieldKernelTestBase::setUp

File

tests/src/Kernel/RadioactivityValueFormatterTest.php, line 42

Class

RadioactivityValueFormatterTest
@coversDefaultClass \Drupal\radioactivity\Plugin\Field\FieldFormatter\RadioactivityValue @group radioactivity

Namespace

Drupal\Tests\radioactivity\Kernel

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->createEnergyField('field_radioactivity', 'Radioactivity', 'count');
  $this->entity = EntityTest::create([
    'field_radioactivity' => [
      'energy' => 5.55555,
      'timestamp' => 0,
    ],
  ]);
  $this->entity
    ->save();
}