You are here

protected function GeofieldWidgetTest::setUp in Geofield 8

Overrides BrowserTestBase::setUp

File

tests/src/Functional/GeofieldWidgetTest.php, line 57

Class

GeofieldWidgetTest
Tests the Geofield widgets.

Namespace

Drupal\Tests\geofield\Functional

Code

protected function setUp() {
  parent::setUp();
  $this->fieldStorage = FieldStorageConfig::create([
    'field_name' => 'geofield_field',
    'entity_type' => 'entity_test',
    'type' => 'geofield',
    'settings' => [
      'backend' => 'geofield_backend_default',
    ],
  ]);
  $this->fieldStorage
    ->save();
  $this->field = FieldConfig::create([
    'field_storage' => $this->fieldStorage,
    'bundle' => 'entity_test',
    'description' => 'Description for geofield_field',
    'settings' => [
      'backend' => 'geofield_backend_default',
    ],
    'required' => TRUE,
  ]);
  $this->field
    ->save();
  $this->assertSession = $this
    ->assertSession();

  // Create a web user.
  $this
    ->drupalLogin($this
    ->drupalCreateUser([
    'view test entity',
    'administer entity_test content',
  ]));
}