You are here

public function DateRecurFieldItemTest::testMissingStart in Recurring Dates Field 3.0.x

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

Tests value is emptied if start is empty.

File

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

Class

DateRecurFieldItemTest
Tests date_recur field.

Namespace

Drupal\Tests\date_recur\Kernel

Code

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

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