private function RoutesTest::getStubMockedIndex in JSON:API Search API 8
Get an initial stubbed mocked index.
Parameters
string $index_id: The index ID.
bool $status: The index status.
Return value
\Prophecy\Prophecy\ObjectProphecy The stub mocked index.
1 call to RoutesTest::getStubMockedIndex()
- RoutesTest::routeDataProvider in tests/
src/ Unit/ RoutesTest.php - Test data for route generation.
File
- tests/
src/ Unit/ RoutesTest.php, line 149
Class
- RoutesTest
- Tests route generation.
Namespace
Drupal\Tests\jsonapi_search_api\UnitCode
private function getStubMockedIndex(string $index_id = 'test_index', bool $status = TRUE) : ProphecyInterface {
$index = $this
->prophesize(IndexInterface::class);
$index
->id()
->willReturn($index_id);
$index
->uuid()
->willReturn((new Php())
->generate());
$index
->getEntityTypeId()
->willReturn('search_api_index');
$index
->bundle()
->willReturn('search_api_index');
$index
->status()
->willReturn($status);
return $index;
}