$client,
[ 'settings' =>
[],
],
$this->
createMock(IndexMappingProvider::
class),
$eventDispatcher );
$calledCreateEvent = false;
$eventDispatcher->
addListener(ElasticsearchIndexCreatedEvent::
class,
static function DElasticsearchIndexCreatedEvent
$event) use (&
$calledCreateEvent): void
{ $calledCreateEvent = true;
static::
assertSame('foo',
$event->
getIndexName());
static::
assertInstanceOf(ElasticsearchProductDefinition::
class,
$event->
getDefinition());
});
$calledConfigEvent = false;
$eventDispatcher->
addListener(ElasticsearchIndexConfigEvent::
class,
function DElasticsearchIndexConfigEvent
$event) use (&
$calledConfigEvent): void
{ $calledConfigEvent = true;
$event->
setConfig($event->
getConfig() +
['event' => true
]);
});
$definition =
$this->
createMock(ElasticsearchProductDefinition::
class);