function FilterStringTest::testFilterStringGroupedExposedStarts

Same name and namespace in other branches
  1. 8.9.x core/modules/views/tests/src/Kernel/Handler/FilterStringTest.php \Drupal\Tests\views\Kernel\Handler\FilterStringTest::testFilterStringGroupedExposedStarts()
  2. 10 core/modules/views/tests/src/Kernel/Handler/FilterStringTest.php \Drupal\Tests\views\Kernel\Handler\FilterStringTest::testFilterStringGroupedExposedStarts()
  3. 11.x core/modules/views/tests/src/Kernel/Handler/FilterStringTest.php \Drupal\Tests\views\Kernel\Handler\FilterStringTest::testFilterStringGroupedExposedStarts()

File

core/modules/views/tests/src/Kernel/Handler/FilterStringTest.php, line 398

Class

FilterStringTest
Tests the core <a href="/api/drupal/core%21modules%21views%21src%21Plugin%21views%21filter%21StringFilter.php/class/StringFilter/9" title="Basic textfield filter to handle string filtering commands." class="local">Drupal\views\Plugin\views\filter\StringFilter</a> handler.

Namespace

Drupal\Tests\views\Kernel\Handler

Code

public function testFilterStringGroupedExposedStarts() {
    $filters = $this->getGroupedExposedFilters();
    $view = $this->getBasicPageView();
    // Filter: Name, Operator: starts, Value: George
    $filters['description']['group_info']['default_group'] = 2;
    $view->setDisplay('page_1');
    $view->displayHandlers
        ->get('page_1')
        ->overrideOption('filters', $filters);
    $view->save();
    $this->executeView($view);
    $resultset = [
        [
            'name' => 'George',
        ],
    ];
    $this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.