Closed vitalyiegorov closed 6 years ago
Currently I think you would have to do that through a middleware. If you override setClient
in your feature context class you could do something like this:
<?php
use Imbo\BehatApiExtension\Context\ApiContext;
use GuzzleHttp\ClientInterface;
use Psr\Http\Message\RequestInterface;
class FeatureContext extends ApiContext {
public function setClient(ClientInterface $client) {
$client->getConfig('handler')->push(function(callable $handler) {
return function(RequestInterface $request, array $options) use ($handler) {
$options['verify'] = false;
return $handler($request, $options);
};
});
return parent::setClient($client);
}
}
I haven't tested the code above, but I think it might work as expected.
It would probably be a good idea to expose the configuration for the client in the extension configuration though...
If the snippet works and you feel it's an adequate solution to your problem please close the issue.
@christeredvartsen Added PR #66
@christeredvartsen We want to use this extension within local development and we are facing:
Any workaround for this?