You are here

protected function CategoryAutocompleteTest::setUp in Drupal 10

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

File

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

Class

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

Namespace

Drupal\Tests\block\Unit

Code

protected function setUp() : void {
  $block_manager = $this
    ->createMock('Drupal\\Core\\Block\\BlockManagerInterface');
  $block_manager
    ->expects($this
    ->any())
    ->method('getCategories')
    ->will($this
    ->returnValue([
    'Comment',
    'Node',
    'None & Such',
    'User',
  ]));
  $this->autocompleteController = new CategoryAutocompleteController($block_manager);
}