You are here

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

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

Overrides BrowserTestBase::setUp

File

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

Class

DateRecurModularAlphaTest
Tests Alpha 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_alpha';
  $component['settings'] = [];
  $display
    ->setComponent('dr', $component);
  $display
    ->save();
  $user = $this
    ->drupalCreateUser([
    'administer entity_test content',
  ]);
  $user->timezone = 'Asia/Singapore';
  $user
    ->save();
  $this
    ->drupalLogin($user);
}