function CategoryAutocompleteTest::providerTestAutocompleteSuggestions

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

Class

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

Namespace

Drupal\Tests\block\Unit

Code

public static 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.