function CategoryAutocompleteTest::setUp
Same name in other branches
- 9 core/modules/block/tests/src/Unit/CategoryAutocompleteTest.php \Drupal\Tests\block\Unit\CategoryAutocompleteTest::setUp()
- 8.9.x core/modules/block/tests/src/Unit/CategoryAutocompleteTest.php \Drupal\Tests\block\Unit\CategoryAutocompleteTest::setUp()
- 10 core/modules/block/tests/src/Unit/CategoryAutocompleteTest.php \Drupal\Tests\block\Unit\CategoryAutocompleteTest::setUp()
Overrides UnitTestCase::setUp
File
-
core/
modules/ block/ tests/ src/ Unit/ CategoryAutocompleteTest.php, line 28
Class
- CategoryAutocompleteTest
- @coversDefaultClass \Drupal\block\Controller\CategoryAutocompleteController @group block
Namespace
Drupal\Tests\block\UnitCode
protected function setUp() : void {
parent::setUp();
$block_manager = $this->createMock('Drupal\\Core\\Block\\BlockManagerInterface');
$block_manager->expects($this->any())
->method('getCategories')
->willReturn([
'Comment',
'Node',
'None & Such',
'User',
]);
$this->autocompleteController = new CategoryAutocompleteController($block_manager);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.