You are here

public function DateRecurPartGridUnitTest::testSettingsToGridAllFrequenciesDisabled in Recurring Dates Field 3.1.x

Same name and namespace in other branches
  1. 8.2 tests/src/Unit/DateRecurPartGridUnitTest.php \Drupal\Tests\date_recur\Unit\DateRecurPartGridUnitTest::testSettingsToGridAllFrequenciesDisabled()
  2. 3.x tests/src/Unit/DateRecurPartGridUnitTest.php \Drupal\Tests\date_recur\Unit\DateRecurPartGridUnitTest::testSettingsToGridAllFrequenciesDisabled()
  3. 3.0.x tests/src/Unit/DateRecurPartGridUnitTest.php \Drupal\Tests\date_recur\Unit\DateRecurPartGridUnitTest::testSettingsToGridAllFrequenciesDisabled()

Tests config settings to grid helper.

@covers ::configSettingsToGrid

File

tests/src/Unit/DateRecurPartGridUnitTest.php, line 85

Class

DateRecurPartGridUnitTest
Tests part grid class.

Namespace

Drupal\Tests\date_recur\Unit

Code

public function testSettingsToGridAllFrequenciesDisabled() {
  $parts = [
    'all' => FALSE,
    'frequencies' => [
      'WEEKLY' => [],
    ],
  ];
  $partGrid = DateRecurPartGrid::configSettingsToGrid($parts);

  // Test defined frequency.
  $this
    ->assertFalse($partGrid
    ->isFrequencyAllowed('WEEKLY'));

  // Test undefined frequency.
  $this
    ->assertFalse($partGrid
    ->isFrequencyAllowed('DAILY'));
}