Skip to content

Commit

Permalink
Instatiate Guzzle with 'verify' off
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiu-cristea committed Dec 6, 2023
1 parent 3f21a05 commit 48d2590
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Behat\MinkExtension\ServiceContainer\Driver\BrowserKitFactory as BrowserKitFactoryOriginal;
use Behat\Mink\Driver\BrowserKitDriver;
use DrupalFinder\DrupalFinder;
use GuzzleHttp\Client;
use Symfony\Component\DependencyInjection\Definition;

class BrowserKitFactory extends BrowserKitFactoryOriginal
Expand All @@ -31,8 +32,21 @@ public function buildDriver(array $config): Definition
);
}

$guzzleClientService = new Definition(Client::class, [
[
// Disable SSL peer verification so that testing under HTTPS always
// works.
// @see \Drupal\Tests\BrowserTestBase::initMink
'verify' => false,
'allow_redirects' => false,
'cookies' => true,
],
]);
$testBrowserService = (new Definition('Drupal\Tests\DrupalTestBrowser'))
->addMethodCall('setClient', [$guzzleClientService]);

return new Definition(BrowserKitDriver::class, [
new Definition('Drupal\Tests\DrupalTestBrowser'),
$testBrowserService,
'%mink.base_url%',
]);
}
Expand Down

0 comments on commit 48d2590

Please sign in to comment.