You are here

protected function DateRecurModularSierraTest::setUp in Recurring Date Field Modular Widgets 8

Same name and namespace in other branches
  1. 3.x tests/src/Functional/DateRecurModularSierraTest.php \Drupal\Tests\date_recur_modular\Functional\DateRecurModularSierraTest::setUp()
  2. 2.x tests/src/Functional/DateRecurModularSierraTest.php \Drupal\Tests\date_recur_modular\Functional\DateRecurModularSierraTest::setUp()

Overrides BrowserTestBase::setUp

File

tests/src/Functional/DateRecurModularSierraTest.php, line 36

Class

DateRecurModularSierraTest
Tests Sierra Widget.

Namespace

Drupal\Tests\date_recur_modular\Functional

Code

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

  // @todo replace in 8.8: See 2835616.
  $display = \entity_get_form_display('dr_entity_test', 'dr_entity_test', 'default');
  $component = $display
    ->getComponent('dr');
  $component['region'] = 'content';
  $component['type'] = 'date_recur_modular_sierra';
  $component['settings'] = [];
  $display
    ->setComponent('dr', $component);
  $display
    ->save();
  $user = $this
    ->drupalCreateUser([
    'administer entity_test content',
  ]);
  $user->timezone = 'Asia/Singapore';
  $user
    ->save();
  $this
    ->drupalLogin($user);
}