You are here

public function DateRecurNonRecurringHelperUnitTest::testInvalidLimit in Recurring Dates Field 3.1.x

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

Tests invalid argument for limit.

File

tests/src/Unit/DateRecurNonRecurringHelperUnitTest.php, line 82

Class

DateRecurNonRecurringHelperUnitTest
Tests non-recurring implementation of helper.

Namespace

Drupal\Tests\date_recur\Unit

Code

public function testInvalidLimit() {
  $helper = $this
    ->createHelper(new \DateTime('2am 14 April 2014'), new \DateTime('4am 14 April 2014'));
  $this
    ->expectException(\InvalidArgumentException::class);
  $this
    ->expectExceptionMessage('Invalid count limit.');
  $helper
    ->getOccurrences(new \DateTime('1am 14 April 2014'), new \DateTime('3am 14 April 2014'), -1);
}