function SearchPageRepositoryTest::setUp
Same name in other branches
- 8.9.x core/modules/search/tests/src/Unit/SearchPageRepositoryTest.php \Drupal\Tests\search\Unit\SearchPageRepositoryTest::setUp()
- 10 core/modules/search/tests/src/Unit/SearchPageRepositoryTest.php \Drupal\Tests\search\Unit\SearchPageRepositoryTest::setUp()
- 11.x core/modules/search/tests/src/Unit/SearchPageRepositoryTest.php \Drupal\Tests\search\Unit\SearchPageRepositoryTest::setUp()
Overrides UnitTestCase::setUp
File
-
core/
modules/ search/ tests/ src/ Unit/ SearchPageRepositoryTest.php, line 52
Class
- SearchPageRepositoryTest
- @coversDefaultClass \Drupal\search\SearchPageRepository @group search
Namespace
Drupal\Tests\search\UnitCode
protected function setUp() : void {
$this->query = $this->createMock('Drupal\\Core\\Entity\\Query\\QueryInterface');
$this->storage = $this->createMock('Drupal\\Core\\Config\\Entity\\ConfigEntityStorageInterface');
$this->storage
->expects($this->any())
->method('getQuery')
->willReturn($this->query);
/** @var \Drupal\Core\Entity\EntityTypeManagerInterface|\PHPUnit\Framework\MockObject\MockObject $entity_type_manager */
$entity_type_manager = $this->createMock(EntityTypeManagerInterface::class);
$entity_type_manager->expects($this->any())
->method('getStorage')
->willReturn($this->storage);
$this->configFactory = $this->createMock('Drupal\\Core\\Config\\ConfigFactoryInterface');
$this->searchPageRepository = new SearchPageRepository($this->configFactory, $entity_type_manager);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.