Skip to content

Commit

Permalink
Allow timeout configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
ericmartel authored Nov 25, 2017
1 parent 192f1cf commit 5aa917b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/MailHog.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class MailHog extends Module
*
* @var array
*/
protected $config = array('url', 'port', 'guzzleRequestOptions', 'deleteEmailsAfterScenario');
protected $config = array('url', 'port', 'guzzleRequestOptions', 'deleteEmailsAfterScenario', 'timeout');

/**
* Codeception required variables
Expand All @@ -71,7 +71,10 @@ public function _initialize()
{
$url = trim($this->config['url'], '/') . ':' . $this->config['port'];

$this->mailhog = new \GuzzleHttp\Client(['base_uri' => $url, 'timeout' => 1.0]);
$timeout = 1.0;
if(isset($this->config['timeout']))
$timeout = $this->config['timeout'];
$this->mailhog = new \GuzzleHttp\Client(['base_uri' => $url, 'timeout' => $timeout]);

if (isset($this->config['guzzleRequestOptions'])) {
foreach ($this->config['guzzleRequestOptions'] as $option => $value) {
Expand Down

0 comments on commit 5aa917b

Please sign in to comment.