You are here

public function KeyValueLongItemTest::testFieldCreate in Key value field 8

Test key_value_long field creation.

File

tests/src/Kernel/KeyValueLongItemTest.php, line 17

Class

KeyValueLongItemTest
@coversDefaultClass \Drupal\key_value_field\Plugin\Field\FieldType\KeyValueLongItem @group key_value_field

Namespace

Drupal\Tests\key_value_field\Kernel

Code

public function testFieldCreate() {
  $this
    ->createTestField('key_value_long');
  $entity = EntityTest::create([
    'test_key_value_field' => [
      'value' => '',
    ],
  ]);
  $entity
    ->save();
  $this
    ->assertTrue($entity->test_key_value_field
    ->isEmpty());
  $this
    ->assertEquals(NULL, $entity->test_key_value_field->value);
}