You are here

public function DateRecurModularOscarTest::testFullDay in Recurring Date Field Modular Widgets 8

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

Tests full day.

File

tests/src/Functional/DateRecurModularOscarTest.php, line 489

Class

DateRecurModularOscarTest
Tests Oscar Widget.

Namespace

Drupal\Tests\date_recur_modular\Functional

Code

public function testFullDay() : void {
  $entity = DrEntityTest::create();
  $entity
    ->save();
  $entity->dr = [
    'value' => '2015-04-13T16:00:00',
    'end_value' => '2015-04-14T15:58:00',
    'rrule' => 'FREQ=WEEKLY;INTERVAL=1;COUNT=1',
    'timezone' => 'Asia/Singapore',
  ];
  $entity
    ->save();

  // Ensure all day is pre-checked if day is not full.
  $this
    ->drupalGet($entity
    ->toUrl('edit-form'));
  $this
    ->assertSession()
    ->checkboxNotChecked('dr[0][is_all_day]');

  // Ensure all day is pre-checked if day is full.
  $entity->dr->end_value = '2015-04-14T15:59:00';
  $entity
    ->save();
  $this
    ->drupalGet($entity
    ->toUrl('edit-form'));
  $this
    ->assertSession()
    ->checkboxChecked('dr[0][is_all_day]');
}