function CategoryAutocompleteTest::providerTestAutocompleteSuggestions

Same name in other branches
  1. 8.9.x core/modules/block/tests/src/Unit/CategoryAutocompleteTest.php \Drupal\Tests\block\Unit\CategoryAutocompleteTest::providerTestAutocompleteSuggestions()
  2. 10 core/modules/block/tests/src/Unit/CategoryAutocompleteTest.php \Drupal\Tests\block\Unit\CategoryAutocompleteTest::providerTestAutocompleteSuggestions()
  3. 11.x 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 60

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;
}

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