You are here

public function DateRecurFieldItemTest::testMissingEnd 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::testMissingEnd()
  2. 3.0.x tests/src/Kernel/DateRecurFieldItemTest.php \Drupal\Tests\date_recur\Kernel\DateRecurFieldItemTest::testMissingEnd()
  3. 3.1.x tests/src/Kernel/DateRecurFieldItemTest.php \Drupal\Tests\date_recur\Kernel\DateRecurFieldItemTest::testMissingEnd()

Tests value is emptied if end is empty.

File

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

Class

DateRecurFieldItemTest
Tests date_recur field.

Namespace

Drupal\Tests\date_recur\Kernel

Code

public function testMissingEnd() {
  $entity = DrEntityTest::create();
  $entity->dr = [
    [
      'value' => '2008-06-16T00:00:00',
      'timezone' => 'Pacific/Chuuk',
    ],
  ];

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