- /** @var \Drupal\entity_test\Entity\EntityTestUpdate $entity */
- $storage->create(['name' => 'First entity'])->save();
- $storage->create(['name' => 'Second entity'])->save();
+ /** @var \Drupal\entity_test_update\Entity\EntityTestUpdate $entity */
+ $storage->create([
+ 'name' => 'First entity',
+ 'test_single_property' => 'test existing value',
+ ])->save();
+
+ // The second entity does not have any value for the 'test_single_property'
+ // field, allowing us to test the 'default_value' parameter of
+ // \Drupal\Core\Field\BaseFieldDefinition::setInitialValueFromField().
+ $storage->create([
+ 'name' => 'Second entity',
+ ])->save();