You are here

public function CategoryAutocompleteTest::providerTestAutocompleteSuggestions in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/block/tests/src/Unit/CategoryAutocompleteTest.php \Drupal\Tests\block\Unit\CategoryAutocompleteTest::providerTestAutocompleteSuggestions()

Data provider for testAutocompleteSuggestions().

Return value

array

File

core/modules/block/tests/src/Unit/CategoryAutocompleteTest.php, line 57

Class

CategoryAutocompleteTest
@coversDefaultClass \Drupal\block\Controller\CategoryAutocompleteController @group block

Namespace

Drupal\Tests\block\Unit

Code

public function providerTestAutocompleteSuggestions() {
  $test_parameters = [];
  $test_parameters[] = [
    'string' => 'Com',
    'suggestions' => [
      'Comment',
    ],
  ];
  $test_parameters[] = [
    'string' => 'No',
    'suggestions' => [
      'Node',
      'None & Such',
    ],
  ];
  $test_parameters[] = [
    'string' => 'us',
    'suggestions' => [
      'User',
    ],
  ];
  $test_parameters[] = [
    'string' => 'Banana',
    'suggestions' => [],
  ];
  return $test_parameters;
}