You are here

protected function DateRecurViewsOccurrenceFilterTest::assertFilter in Recurring Dates Field 3.0.x

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

Asserts the filter plugin.

Parameters

array $input: Input for exposed filters.

array $expectedResult: The expected result.

array $filterOptions: Options to set via exposed inputs.

string|null $message: Message for phpunit.

6 calls to DateRecurViewsOccurrenceFilterTest::assertFilter()
DateRecurViewsOccurrenceFilterTest::testDateRecurFilterAbsoluteDay in tests/src/Kernel/DateRecurViewsOccurrenceFilterTest.php
Tests date recur filter plugin.
DateRecurViewsOccurrenceFilterTest::testDateRecurFilterAbsoluteMonth in tests/src/Kernel/DateRecurViewsOccurrenceFilterTest.php
Tests date recur filter plugin.
DateRecurViewsOccurrenceFilterTest::testDateRecurFilterAbsoluteSecond in tests/src/Kernel/DateRecurViewsOccurrenceFilterTest.php
Tests date recur filter plugin.
DateRecurViewsOccurrenceFilterTest::testDateRecurFilterAbsoluteYear in tests/src/Kernel/DateRecurViewsOccurrenceFilterTest.php
Tests date recur filter plugin.
DateRecurViewsOccurrenceFilterTest::testDateRecurFilterTimezoneNonSecond in tests/src/Kernel/DateRecurViewsOccurrenceFilterTest.php
Tests timezone capability for non second granularity.

... See full list

File

tests/src/Kernel/DateRecurViewsOccurrenceFilterTest.php, line 790

Class

DateRecurViewsOccurrenceFilterTest
Tests the results of 'date_recur_occurrences_filter' filter plugin.

Namespace

Drupal\Tests\date_recur\Kernel

Code

protected function assertFilter(array $input, array $expectedResult, array $filterOptions, $message = NULL) {

  /** @var \Drupal\views\ViewEntityInterface $view */
  $view = View::load('dr_entity_test_list');
  $executable = $view
    ->getExecutable();
  $executable
    ->addHandler('default', 'filter', 'dr_entity_test', $this->fieldName . '_occurrences', $filterOptions);
  $executable
    ->setExposedInput($input);
  $this
    ->executeView($executable);
  $this
    ->assertCount(count($expectedResult), $executable->result);
  $this
    ->assertIdenticalResultset($executable, $expectedResult, $this->map, $message);

  // Must be destroyed after each run.
  $executable
    ->destroy();
}