Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to mock ClientBuilder in unit testing due to Monolog dependency inside #813

Closed
JerryDing2014 opened this issue Oct 18, 2018 · 1 comment · Fixed by #948
Closed

Comments

@JerryDing2014
Copy link

Summary of problem or feature request

When mocking ClientBuilder in a unit test, it will throw out a not found exception "Monolog not found".

Looked into the code, found that defaultLogger() returns a \Monolog\Logger\Logger which is not included in composer.json

Checked the latest ClientBuilder in master branch, the dependency is till and is not included in composer.json even though #674 was in "merged" status.

Code snippet of problem

\Mockery::mock(ClientBuilder::class); //<- throw exception, Monolog not found

System details

  • Operating System: centos 7
  • PHP Version: 5.6
  • ES-PHP client version: 5.0
  • Elasticsearch version: 6.4
@ezimuel
Copy link
Contributor

ezimuel commented Aug 30, 2019

@JerryDing2014 sorry for the very long reply on this. You right, this is an old requirement that has been removed with the usage of PSR-3 Logger. Anyway, the Monolog is still present in the use of ClientBuilder code but never used. I'll remove it asap. Thanks and sorry again for the late reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants