function FilterStringTest::testFilterStringNotEqual

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

File

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

Class

FilterStringTest
Tests the core <a href="/api/drupal/core%21modules%21views%21src%21Plugin%21views%21filter%21StringFilter.php/class/StringFilter/11.x" 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 testFilterStringNotEqual() : void {
    $view = Views::getView('test_view');
    $view->setDisplay();
    // Change the filtering
    $view->displayHandlers
        ->get('default')
        ->overrideOption('filters', [
        'name' => [
            'id' => 'name',
            'table' => 'views_test_data',
            'field' => 'name',
            'relationship' => 'none',
            'operator' => '!=',
            'value' => 'Ringo',
        ],
    ]);
    $this->executeView($view);
    $resultset = [
        [
            'name' => 'John',
        ],
        [
            'name' => 'George',
        ],
        [
            'name' => 'Paul',
        ],
        [
            'name' => 'Meredith',
        ],
    ];
    $this->assertIdenticalResultset($view, $resultset, $this->columnMap);
}

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