You are here

protected function GeolocationItemTest::setUp in Geolocation Field 8

Same name and namespace in other branches
  1. 8.3 tests/src/Kernel/GeolocationItemTest.php \Drupal\Tests\geolocation\Kernel\GeolocationItemTest::setUp()
  2. 8.2 tests/src/Kernel/GeolocationItemTest.php \Drupal\Tests\geolocation\Kernel\GeolocationItemTest::setUp()

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

Overrides FieldKernelTestBase::setUp

File

tests/src/Kernel/GeolocationItemTest.php, line 28

Class

GeolocationItemTest
Tests the new entity API for the geolocation field type.

Namespace

Drupal\Tests\geolocation\Kernel

Code

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

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