diff --git a/src/SecLibGateway.php b/src/SecLibGateway.php index 37abfa0..d25a044 100755 --- a/src/SecLibGateway.php +++ b/src/SecLibGateway.php @@ -66,8 +66,8 @@ public function __construct($host, array $auth, Filesystem $files, $timeout) { $this->auth = $auth; $this->files = $files; - $this->setHostAndPort($host); $this->setTimeout($timeout); + $this->setHostAndPort($host); } /** @@ -86,7 +86,7 @@ protected function setHostAndPort($host) if (!filter_var($host, FILTER_VALIDATE_IP) && Str::contains($host, ':')) { $this->host = Str::beforeLast($host, ':'); - $this->port = (int)Str::afterLast($host, ':'); + $this->port = (int) Str::afterLast($host, ':'); } if (filter_var($this->host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { diff --git a/tests/RemoteSecLibTest.php b/tests/RemoteSecLibTest.php index 1a8c6c4..9cefdae 100644 --- a/tests/RemoteSecLibTest.php +++ b/tests/RemoteSecLibTest.php @@ -105,7 +105,7 @@ public function getGateway($host = '127.0.0.1:22') $files = m::mock('Illuminate\Filesystem\Filesystem'); $files->shouldReceive('get')->with('keypath')->andReturn('keystuff'); $gateway = m::mock('Collective\Remote\SecLibGateway[!setTimeout]', [ - '127.0.0.1:22', + $host, ['username' => 'taylor', 'key' => 'keypath', 'keyphrase' => 'keyphrase'], $files, 10,