You are here

function FilterStringTest::testFilterStringContains in Views (for Drupal 7) 8.3

File

lib/Drupal/views/Tests/Handler/FilterStringTest.php, line 188
Definition of Drupal\views\Tests\Handler\FilterStringTest.

Class

FilterStringTest
Tests the core Drupal\views\Plugin\views\filter\String handler.

Namespace

Drupal\views\Tests\Handler

Code

function testFilterStringContains() {
  $view = $this
    ->getView();

  // Change the filtering
  $view->displayHandlers['default']
    ->overrideOption('filters', array(
    'name' => array(
      'id' => 'name',
      'table' => 'views_test_data',
      'field' => 'name',
      'relationship' => 'none',
      'operator' => 'contains',
      'value' => 'ing',
    ),
  ));
  $this
    ->executeView($view);
  $resultset = array(
    array(
      'name' => 'Ringo',
    ),
  );
  $this
    ->assertIdenticalResultset($view, $resultset, $this->column_map);
}