1
0
mirror of https://github.com/ovh/php-ovh.git synced 2023-11-05 03:20:26 +01:00

fix: hook that modify Guzzle parameters serialization when true/false value

Signed-off-by: Romain Beuque <romain.beuque@corp.ovh.com>
This commit is contained in:
Romain Beuque 2016-02-01 10:34:34 +00:00
parent 57ba00310d
commit d3bd44ed68
2 changed files with 15 additions and 1 deletions

View File

@ -235,6 +235,20 @@ class Api
}
$query = array_merge($query, (array)$content);
// rewrite query args to properly dump true/false parameters
foreach($query as $key => $value)
{
if ($value === false)
{
$query[$key] = "false";
}
elseif ($value === true)
{
$query[$key] = "true";
}
}
$query = \GuzzleHttp\Psr7\build_query($query);
$url = $request->getUri()->withQuery($query);

View File

@ -364,7 +364,7 @@ class ApiTest extends \PHPUnit_Framework_TestCase
//}));
$api = new Api($this->application_key, $this->application_secret, $this->endpoint, $this->consumer_key, $this->client);
$api->get('/me/api/credential', ['dryRun' => true, 'noDryRun' => false]);
$api->get('/me/api/credential', ['dryRun' => true, 'notDryRun' => false]);
}
}