Closed stevebauman closed 3 years ago
I can write a PR to move all of these to the handle
method and adjust the tests to follow suit, just let me know if you're okay with that 👍
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days
Hey @stevebauman, sorry for the late response, I was sure I've answered on this one. Please go ahead with the PR if it's still relevant.
No worries @babenkoivan! Appreciate the response. I've just submitted the PR 👍
Describe the bug If you set
ELASTIC_HOST
to a blank string ornull
, theFreshCommand
asks for an instance ofIndexManagerInterface
, which in turn attempts to create an ElasticSearch client with configuration.https://github.com/babenkoivan/elastic-client/blob/9d4eab0ce97c48e60cf63c8fee7a547d41045129/config/elastic.client.php#L5
This is a problem due to running application tests using
<env>
supplied by aphpunit.xml
file, rather than an actual.env
file:Resolution
Console type-hinted dependencies should be moved to the
handle
methods so they are only retrieved when the commands are ran, instead of during every single request. Ex:Before:
After:
https://laravel.com/docs/8.x/artisan#command-structure
To Reproduce
composer require babenkoivan/elastic-migrations
ELASTIC_HOST
default valuecomposer dump-autoload