Skip to content

Commit

Permalink
Merge pull request #1543 from pantheon-systems/1532-workflow-logs
Browse files Browse the repository at this point in the history
Issue #1532 Workflow logs not hydrated
  • Loading branch information
Ronan Dowling committed Jan 20, 2017
2 parents 173f720 + 0a15cd0 commit 4174a93
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Request/Request.php
Expand Up @@ -157,6 +157,10 @@ private function send($path, array $options = [])
$uri = $path;
}

if (!empty($options['query'])) {
$uri .= '?' . http_build_query($options['query'], null, '&', PHP_QUERY_RFC3986);
}

$body = isset($options['form_params']) ? json_encode($options['form_params']) : null;

$method = isset($options['method']) ? strtoupper($options['method']) : 'GET';
Expand Down
24 changes: 24 additions & 0 deletions tests/unit_tests/Request/RequestTest.php
Expand Up @@ -224,6 +224,30 @@ public function testRequestFullPath()
$this->makeRequest($client_options, $request_options, 'http://foo.bar/a/b/c');
}

public function testRequestWithQuery()
{
$this->session->method('get')->with('session')->willReturn(false);

$client_options = ['base_uri' => 'https://example.com:443', RequestOptions::VERIFY => true];

$method = 'GET';
$uri = 'https://example.com:443/api/foo/bar?foo=bar';
$headers = [
'Content-type' => 'application/json',
'User-Agent' => 'Terminus/1.1.1 (php_version=7.0.0&script=foo/bar/baz.php)'
];
$body = '';
$request_options = [$method, $uri, $headers, $body];
$actual = $this->makeRequest($client_options, $request_options, 'foo/bar', ['query' => ['foo' => 'bar']]);
$expected = [
'data' => (object)['abc' => '123'],
'headers' => ['Content-type' => 'application/json'],
'status_code' => 200,
];
$this->assertEquals($expected, $actual);
}


public function testRequestNoVerify()
{
$this->config->set('verify_host_cert', false);
Expand Down

0 comments on commit 4174a93

Please sign in to comment.