'promotion' =>
[ 'total' => 1,
'data' =>
new EntityCollection([$promotion]),
'indexer' => 'promotion-listing',
'index' => 'sw-admin-promotion-listing',
],
]);
} public function testElasticSearchWithElasticSearchNotEnable(): void
{ $controller =
new AdminSearchController( $this->
getMockBuilder(AdminSearcher::
class)->
disableOriginalConstructor()->
getMock(),
$this->
createMock(DefinitionInstanceRegistry::
class),
$this->
createMock(JsonEntityEncoder::
class),
new AdminElasticsearchHelper(false, false, 'sw-admin'
) );
$request =
new Request();
$request->attributes->
set('term', 'test'
);
$this->
expectException(\RuntimeException::
class);
$this->
expectExceptionMessage('Admin elasticsearch is not enabled'
);