public function SearchExpressionTest::dataProvider

Provides data for the search expression tests.

Return value

array An array of values passed to the test methods.

File

drupal/core/modules/search/tests/Drupal/search/Tests/SearchExpressionTest.php, line 35
Contains \Drupal\search\Tests\SearchExpressionTest.

Class

SearchExpressionTest
Tests the search expression class.

Namespace

Drupal\search\Tests

Code

public function dataProvider() {
  $cases = array(
    // Normal case.
    array(
      'foo',
      'bar',
      'foo:bar',
      'bar',
    ),
    // Empty value: shouldn't insert.
    array(
      'foo',
      NULL,
      '',
      NULL,
    ),
    // Space as value: should insert but retrieve empty string.
    array(
      'foo',
      ' ',
      'foo:',
      '',
    ),
    // Empty string as value: should insert but retrieve empty string.
    array(
      'foo',
      '',
      'foo:',
      '',
    ),
    // String zero as value: should insert.
    array(
      'foo',
      '0',
      'foo:0',
      '0',
    ),
    // Numeric zero as value: should insert.
    array(
      'foo',
      0,
      'foo:0',
      '0',
    ),
  );
  return $cases;
}