# How to mock handlers for elastic search client v8.11.0

**URL:** https://discuss.elastic.co/t/how-to-mock-handlers-for-elastic-search-client-v8-11-0/349614
**Category:** Elasticsearch
**Created:** [December 19, 2023, 3:52am UTC](https://discuss.elastic.co/t/how-to-mock-handlers-for-elastic-search-client-v8-11-0/349614 "2023-12-19T03:52:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![yoss\_fazwaz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yoss_fazwaz/32/129023_2.png) [@yoss\_fazwaz](https://discuss.elastic.co/u/yoss_fazwaz)
#### Post date: [December 19, 2023, 3:52am UTC](https://discuss.elastic.co/t/how-to-mock-handlers-for-elastic-search-client-v8-11-0/349614/1 "2023-12-19T03:52:44Z")

</div>

Hi, guys, I have updated my Elasticsearch client from V7 to V8, and it seems that the `setHandler` is removed. I have no idea how to set it in version 8.

---

<div class="post-metadata">

### Author: ![yoss\_fazwaz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yoss_fazwaz/32/129023_2.png) [@yoss\_fazwaz](https://discuss.elastic.co/u/yoss_fazwaz)
#### Post date: [December 19, 2023, 5:30am UTC](https://discuss.elastic.co/t/how-to-mock-handlers-for-elastic-search-client-v8-11-0/349614/2 "2023-12-19T05:30:56Z")

</div>

No worries, I've found the solution from [here](https://github.com/elastic/elasticsearch-php#mock-the-elasticsearch-client)!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [January 16, 2024, 5:31am UTC](https://discuss.elastic.co/t/how-to-mock-handlers-for-elastic-search-client-v8-11-0/349614/3 "2024-01-16T05:31:55Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
