You are here

public function DateRecurRlHelperUnitTest::testFrequency in Recurring Dates Field 8.2

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

Tests frequency method of rules returned by helper.

File

tests/src/Unit/DateRecurRlHelperUnitTest.php, line 106

Class

DateRecurRlHelperUnitTest
Tests Rlanvin implementation of helper.

Namespace

Drupal\Tests\date_recur\Unit

Code

public function testFrequency() {
  $dtStart = new \DateTime('9am 16 June 2014');
  $rrule = 'FREQ=DAILY;COUNT=10';
  $instance = $this
    ->createHelper($rrule, $dtStart);
  $rules = $instance
    ->getRules();
  $this
    ->assertCount(1, $rules);
  $rule = $rules[0];
  $this
    ->assertEquals('DAILY', $rule
    ->getFrequency());
}