You are here

public function DateRecurFieldItemTest::testNoTimeZone in Recurring Dates Field 8.2

Same name and namespace in other branches
  1. 3.x tests/src/Kernel/DateRecurFieldItemTest.php \Drupal\Tests\date_recur\Kernel\DateRecurFieldItemTest::testNoTimeZone()
  2. 3.0.x tests/src/Kernel/DateRecurFieldItemTest.php \Drupal\Tests\date_recur\Kernel\DateRecurFieldItemTest::testNoTimeZone()
  3. 3.1.x tests/src/Kernel/DateRecurFieldItemTest.php \Drupal\Tests\date_recur\Kernel\DateRecurFieldItemTest::testNoTimeZone()

Tests value is emptied if time zone is empty.

File

tests/src/Kernel/DateRecurFieldItemTest.php, line 267

Class

DateRecurFieldItemTest
Tests date_recur field.

Namespace

Drupal\Tests\date_recur\Kernel

Code

public function testNoTimeZone() {
  $entity = DrEntityTest::create();
  $entity->dr = [
    [
      'value' => '2008-06-16T00:00:00',
      'end_value' => '2008-06-16T06:00:00',
      'rrule' => 'FREQ=DAILY;COUNT=100',
    ],
  ];

  // After saving, empty/invalid values are emptied.
  $entity
    ->save();
  $this
    ->assertEquals(0, $entity->dr
    ->count());
}