diff --git a/CHANGE.md b/CHANGE.md index 0fc4bb7..55d7c6b 100755 --- a/CHANGE.md +++ b/CHANGE.md @@ -1,6 +1,10 @@ Change Log ========== +VERSION 2.5.9 +------------- +* Update the querying methods to use a POST request instead of a GET request + VERSION 2.5.8 ------------- * Fixes a bug with the return type of queries (reverting back to associated arrays) diff --git a/src/Client/KeenIOClient.php b/src/Client/KeenIOClient.php index d118d50..fda27ad 100755 --- a/src/Client/KeenIOClient.php +++ b/src/Client/KeenIOClient.php @@ -40,7 +40,7 @@ class KeenIOClient extends GuzzleClient { - const VERSION = '2.5.8'; + const VERSION = '2.5.9'; /** * Factory to create new KeenIOClient instance. diff --git a/src/Client/Resources/keen-io-3_0.php b/src/Client/Resources/keen-io-3_0.php index 086d346..b19d2ab 100755 --- a/src/Client/Resources/keen-io-3_0.php +++ b/src/Client/Resources/keen-io-3_0.php @@ -445,7 +445,7 @@ 'count' => array( 'uri' => 'projects/{projectId}/queries/count', 'description' => 'GET returns the number of resources in the event collection matching the given criteria. The response will be a simple JSON object with one key: a numeric result.', - 'httpMethod' => 'GET', + 'httpMethod' => 'POST', 'parameters' => array( 'projectId' => array( 'location' => 'uri', @@ -460,38 +460,38 @@ 'required' => false, ), 'event_collection' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The name of the event collection you are analyzing.', 'type' => 'string', 'required' => true, ), 'filters' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Filters are used to narrow down the events used in an analysis request based on event property values.', 'type' => 'array', 'required' => false, ), 'timeframe' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'A Timeframe specifies the events to use for analysis based on a window of time. If no timeframe is specified, all events will be counted.', 'type' => array('string', 'array'), 'filters' => array('KeenIO\Client\Filter\MultiTypeFiltering::encodeValue'), 'required' => false, ), 'interval' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Intervals are used when creating a Series API call. The interval specifies the length of each sub-timeframe in a Series.', 'type' => 'string', 'required' => false, ), 'timezone' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Modifies the timeframe filters for Relative Timeframes to match a specific timezone.', 'type' => array('string', 'number'), 'required' => false, ), 'group_by' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The group_by parameter specifies the name of a property by which you would like to group the results.', 'type' => array('string', 'array'), 'filters' => array('KeenIO\Client\Filter\MultiTypeFiltering::encodeValue'), @@ -503,7 +503,7 @@ 'countUnique' => array( 'uri' => 'projects/{projectId}/queries/count_unique', 'description' => 'GET returns the number of UNIQUE resources in the event collection matching the given criteria. The response will be a simple JSON object with one key: result, which maps to the numeric result described previously.', - 'httpMethod' => 'GET', + 'httpMethod' => 'POST', 'parameters' => array( 'projectId' => array( 'location' => 'uri', @@ -518,44 +518,44 @@ 'required' => false, ), 'event_collection' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The name of the event collection you are analyzing.', 'type' => 'string', 'required' => true, ), 'target_property' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The name of the property you are analyzing.', 'type' => 'string', 'required' => true, ), 'filters' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Filters are used to narrow down the events used in an analysis request based on event property values.', 'type' => 'array', 'required' => false, ), 'timeframe' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'A Timeframe specifies the events to use for analysis based on a window of time. If no timeframe is specified, all events will be counted.', 'type' => array('string', 'array'), 'filters' => array('KeenIO\Client\Filter\MultiTypeFiltering::encodeValue'), 'required' => false, ), 'interval' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Intervals are used when creating a Series API call. The interval specifies the length of each sub-timeframe in a Series.', 'type' => 'string', 'required' => false, ), 'timezone' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Modifies the timeframe filters for Relative Timeframes to match a specific timezone.', 'type' => array('string', 'number'), 'required' => false, ), 'group_by' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The group_by parameter specifies the name of a property by which you would like to group the results.', 'type' => array('string', 'array'), 'filters' => array('KeenIO\Client\Filter\MultiTypeFiltering::encodeValue'), @@ -567,7 +567,7 @@ 'minimum' => array( 'uri' => 'projects/{projectId}/queries/minimum', 'description' => 'GET returns the minimum numeric value for the target property in the event collection matching the given criteria. Non-numeric values are ignored. The response will be a simple JSON object with one key: result, which maps to the numeric result described previously.', - 'httpMethod' => 'GET', + 'httpMethod' => 'POST', 'parameters' => array( 'projectId' => array( 'location' => 'uri', @@ -582,44 +582,44 @@ 'required' => false, ), 'event_collection' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The name of the event collection you are analyzing.', 'type' => 'string', 'required' => true, ), 'target_property' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The name of the property you are analyzing.', 'type' => 'string', 'required' => true, ), 'filters' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Filters are used to narrow down the events used in an analysis request based on event property values.', 'type' => 'array', 'required' => false, ), 'timeframe' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'A Timeframe specifies the events to use for analysis based on a window of time. If no timeframe is specified, all events will be counted.', 'type' => array('string', 'array'), 'filters' => array('KeenIO\Client\Filter\MultiTypeFiltering::encodeValue'), 'required' => false, ), 'interval' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Intervals are used when creating a Series API call. The interval specifies the length of each sub-timeframe in a Series.', 'type' => 'string', 'required' => false, ), 'timezone' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Modifies the timeframe filters for Relative Timeframes to match a specific timezone.', 'type' => array('string', 'number'), 'required' => false, ), 'group_by' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The group_by parameter specifies the name of a property by which you would like to group the results.', 'type' => array('string', 'array'), 'filters' => array('KeenIO\Client\Filter\MultiTypeFiltering::encodeValue'), @@ -631,7 +631,7 @@ 'maximum' => array( 'uri' => 'projects/{projectId}/queries/maximum', 'description' => 'GET returns the maximum numeric value for the target property in the event collection matching the given criteria. Non-numeric values are ignored. The response will be a simple JSON object with one key: result, which maps to the numeric result described previously.', - 'httpMethod' => 'GET', + 'httpMethod' => 'POST', 'parameters' => array( 'projectId' => array( 'location' => 'uri', @@ -646,44 +646,44 @@ 'required' => false, ), 'event_collection' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The name of the event collection you are analyzing.', 'type' => 'string', 'required' => true, ), 'target_property' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The name of the property you are analyzing.', 'type' => 'string', 'required' => true, ), 'filters' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Filters are used to narrow down the events used in an analysis request based on event property values.', 'type' => 'array', 'required' => false, ), 'timeframe' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'A Timeframe specifies the events to use for analysis based on a window of time. If no timeframe is specified, all events will be counted.', 'type' => array('string', 'array'), 'filters' => array('KeenIO\Client\Filter\MultiTypeFiltering::encodeValue'), 'required' => false, ), 'interval' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Intervals are used when creating a Series API call. The interval specifies the length of each sub-timeframe in a Series.', 'type' => 'string', 'required' => false, ), 'timezone' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Modifies the timeframe filters for Relative Timeframes to match a specific timezone.', 'type' => array('string', 'number'), 'required' => false, ), 'group_by' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The group_by parameter specifies the name of a property by which you would like to group the results.', 'type' => array('string', 'array'), 'filters' => array('KeenIO\Client\Filter\MultiTypeFiltering::encodeValue'), @@ -695,7 +695,7 @@ 'average' => array( 'uri' => 'projects/{projectId}/queries/average', 'description' => 'GET returns the average across all numeric values for the target property in the event collection matching the given criteria. Non-numeric values are ignored. The response will be a simple JSON object with one key: result, which maps to the numeric result described previously.', - 'httpMethod' => 'GET', + 'httpMethod' => 'POST', 'parameters' => array( 'projectId' => array( 'location' => 'uri', @@ -710,44 +710,44 @@ 'required' => false, ), 'event_collection' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The name of the event collection you are analyzing.', 'type' => 'string', 'required' => true, ), 'target_property' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The name of the property you are analyzing.', 'type' => 'string', 'required' => true, ), 'filters' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Filters are used to narrow down the events used in an analysis request based on event property values.', 'type' => 'array', 'required' => false, ), 'timeframe' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'A Timeframe specifies the events to use for analysis based on a window of time. If no timeframe is specified, all events will be counted.', 'type' => array('string', 'array'), 'filters' => array('KeenIO\Client\Filter\MultiTypeFiltering::encodeValue'), 'required' => false, ), 'interval' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Intervals are used when creating a Series API call. The interval specifies the length of each sub-timeframe in a Series.', 'type' => 'string', 'required' => false, ), 'timezone' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Modifies the timeframe filters for Relative Timeframes to match a specific timezone.', 'type' => array('string', 'number'), 'required' => false, ), 'group_by' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The group_by parameter specifies the name of a property by which you would like to group the results.', 'type' => array('string', 'array'), 'filters' => array('KeenIO\Client\Filter\MultiTypeFiltering::encodeValue'), @@ -759,7 +759,7 @@ 'sum' => array( 'uri' => 'projects/{projectId}/queries/sum', 'description' => 'GET returns the sum if all numeric values for the target property in the event collection matching the given criteria. Non-numeric values are ignored. The response will be a simple JSON object with one key: result, which maps to the numeric result described previously.', - 'httpMethod' => 'GET', + 'httpMethod' => 'POST', 'parameters' => array( 'projectId' => array( 'location' => 'uri', @@ -774,44 +774,44 @@ 'required' => false, ), 'event_collection' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The name of the event collection you are analyzing.', 'type' => 'string', 'required' => true, ), 'target_property' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The name of the property you are analyzing.', 'type' => 'string', 'required' => true, ), 'filters' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Filters are used to narrow down the events used in an analysis request based on event property values.', 'type' => 'array', 'required' => false, ), 'timeframe' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'A Timeframe specifies the events to use for analysis based on a window of time. If no timeframe is specified, all events will be counted.', 'type' => array('string', 'array'), 'filters' => array('KeenIO\Client\Filter\MultiTypeFiltering::encodeValue'), 'required' => false, ), 'interval' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Intervals are used when creating a Series API call. The interval specifies the length of each sub-timeframe in a Series.', 'type' => 'string', 'required' => false, ), 'timezone' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Modifies the timeframe filters for Relative Timeframes to match a specific timezone.', 'type' => array('string', 'number'), 'required' => false, ), 'group_by' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The group_by parameter specifies the name of a property by which you would like to group the results.', 'type' => array('string', 'array'), 'filters' => array('KeenIO\Client\Filter\MultiTypeFiltering::encodeValue'), @@ -823,7 +823,7 @@ 'selectUnique' => array( 'uri' => 'projects/{projectId}/queries/select_unique', 'description' => 'GET returns a list of UNIQUE resources in the event collection matching the given criteria. The response will be a simple JSON object with one key: result, which maps to an array of unique property values.', - 'httpMethod' => 'GET', + 'httpMethod' => 'POST', 'parameters' => array( 'projectId' => array( 'location' => 'uri', @@ -838,44 +838,44 @@ 'required' => false, ), 'event_collection' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The name of the event collection you are analyzing.', 'type' => 'string', 'required' => true, ), 'target_property' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The name of the property you are analyzing.', 'type' => 'string', 'required' => true, ), 'filters' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Filters are used to narrow down the events used in an analysis request based on event property values.', 'type' => 'array', 'required' => false, ), 'timeframe' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'A Timeframe specifies the events to use for analysis based on a window of time. If no timeframe is specified, all events will be counted.', 'type' => array('string', 'array'), 'filters' => array('KeenIO\Client\Filter\MultiTypeFiltering::encodeValue'), 'required' => false, ), 'interval' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Intervals are used when creating a Series API call. The interval specifies the length of each sub-timeframe in a Series.', 'type' => 'string', 'required' => false, ), 'timezone' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Modifies the timeframe filters for Relative Timeframes to match a specific timezone.', 'type' => array('string', 'number'), 'required' => false, ), 'group_by' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The group_by parameter specifies the name of a property by which you would like to group the results.', 'type' => array('string', 'array'), 'filters' => array('KeenIO\Client\Filter\MultiTypeFiltering::encodeValue'), @@ -887,7 +887,7 @@ 'funnel' => array( 'uri' => 'projects/{projectId}/queries/funnel', 'description' => 'Funnels count relevant events in succession.', - 'httpMethod' => 'GET', + 'httpMethod' => 'POST', 'parameters' => array( 'projectId' => array( 'location' => 'uri', @@ -902,7 +902,7 @@ 'required' => false, ), 'steps' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'A URL encoded JSON Array defining the Steps in the Funnel.', 'type' => 'array', 'required' => false, @@ -913,7 +913,7 @@ 'multiAnalysis' => array( 'uri' => 'projects/{projectId}/queries/multi_analysis', 'description' => 'Multi-analysis lets you run multiple types of analysis over the same data. Performing a multi-analysis call is very similar to a Metric or a Series.', - 'httpMethod' => 'GET', + 'httpMethod' => 'POST', 'parameters' => array( 'projectId' => array( 'location' => 'uri', @@ -928,44 +928,44 @@ 'required' => false, ), 'event_collection' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The name of the event collection you are analyzing.', 'type' => 'string', 'required' => true, ), 'analyses' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'A URL encoded JSON object that defines the multiple types of analyses to perform.', 'type' => 'array', 'required' => true, ), 'filters' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Filters are used to narrow down the events used in an analysis request based on event property values.', 'type' => 'array', 'required' => false, ), 'timeframe' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'A Timeframe specifies the events to use for analysis based on a window of time. If no timeframe is specified, all events will be counted.', 'type' => array('string', 'array'), 'filters' => array('KeenIO\Client\Filter\MultiTypeFiltering::encodeValue'), 'required' => false, ), 'interval' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Intervals are used when creating a Series API call. The interval specifies the length of each sub-timeframe in a Series.', 'type' => 'string', 'required' => false, ), 'timezone' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Modifies the timeframe filters for Relative Timeframes to match a specific timezone.', 'type' => array('string', 'number'), 'required' => false, ), 'group_by' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The group_by parameter specifies the name of a property by which you would like to group the results.', 'type' => array('string', 'array'), 'filters' => array('KeenIO\Client\Filter\MultiTypeFiltering::encodeValue'), @@ -977,7 +977,7 @@ 'extraction' => array( 'uri' => 'projects/{projectId}/queries/extraction', 'description' => 'GET creates an extraction request for full-form event data with all property values. If the query string parameter email is specified, then the extraction will be processed asynchronously and an e-mail will be sent to the specified address when it completes. The email will include a link to a downloadable CSV file. If email is omitted, then the extraction will be processed in-line and JSON results will be returned in the GET request.', - 'httpMethod' => 'GET', + 'httpMethod' => 'POST', 'parameters' => array( 'projectId' => array( 'location' => 'uri', @@ -992,38 +992,38 @@ 'required' => false, ), 'event_collection' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The name of the event collection you are analyzing.', 'type' => 'string', 'required' => true, ), 'filters' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Filters are used to narrow down the events used in an analysis request based on event property values.', 'type' => 'array', 'required' => false, ), 'timeframe' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'A Timeframe specifies the events to use for analysis based on a window of time. If no timeframe is specified, all events will be counted.', 'type' => array('string', 'array'), 'filters' => array('KeenIO\Client\Filter\MultiTypeFiltering::encodeValue'), 'required' => false, ), 'email' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Email that will be notified when your extraction is ready for download.', 'type' => 'string', 'required' => false, ), 'latest' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'An integer containing the number of most recent events to extract.', 'type' => 'number', 'required' => false, ), 'property_names' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'A URL-encoded array of strings containing properties you wish to extract. If this parameter is omitted, all properties will be returned.', 'type' => 'array', 'required' => false, @@ -1034,7 +1034,7 @@ 'median' => array( 'uri' => 'projects/{projectId}/queries/median', 'description' => 'GET returns the median across all numeric values for the target property in the event collection matching the given criteria. Non-numeric values are ignored. The response will be a simple JSON object with one key: result, which maps to the numeric result described previously.', - 'httpMethod' => 'GET', + 'httpMethod' => 'POST', 'parameters' => array( 'projectId' => array( 'location' => 'uri', @@ -1049,44 +1049,44 @@ 'required' => false, ), 'event_collection' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The name of the event collection you are analyzing.', 'type' => 'string', 'required' => true, ), 'target_property' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The name of the property you are analyzing.', 'type' => 'string', 'required' => true, ), 'filters' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Filters are used to narrow down the events used in an analysis request based on event property values.', 'type' => 'array', 'required' => false, ), 'timeframe' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'A Timeframe specifies the events to use for analysis based on a window of time. If no timeframe is specified, all events will be counted.', 'type' => array('string', 'array'), 'filters' => array('KeenIO\Client\Filter\MultiTypeFiltering::encodeValue'), 'required' => false, ), 'interval' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Intervals are used when creating a Series API call. The interval specifies the length of each sub-timeframe in a Series.', 'type' => 'string', 'required' => false, ), 'timezone' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Modifies the timeframe filters for Relative Timeframes to match a specific timezone.', 'type' => 'number', 'required' => false, ), 'group_by' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The group_by parameter specifies the name of a property by which you would like to group the results.', 'type' => array('string', 'array'), 'filters' => array('KeenIO\Client\Filter\MultiTypeFiltering::encodeValue'), @@ -1098,7 +1098,7 @@ 'percentile' => array( 'uri' => 'projects/{projectId}/queries/percentile', 'description' => 'GET returns the Xth percentile value across all numeric values for the target property in the event collection matching the given criteria. Non-numeric values are ignored. The response will be a simple JSON object with one key: result, which maps to the numeric result described previously.', - 'httpMethod' => 'GET', + 'httpMethod' => 'POST', 'parameters' => array( 'projectId' => array( 'location' => 'uri', @@ -1113,51 +1113,51 @@ 'required' => false, ), 'event_collection' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The name of the event collection you are analyzing.', 'type' => 'string', 'required' => true, ), 'target_property' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The name of the property you are analyzing.', 'type' => 'string', 'required' => true, ), 'filters' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Filters are used to narrow down the events used in an analysis request based on event property values.', 'type' => 'array', 'required' => false, ), 'timeframe' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'A Timeframe specifies the events to use for analysis based on a window of time. If no timeframe is specified, all events will be counted.', 'type' => array('string', 'array'), 'filters' => array('KeenIO\Client\Filter\MultiTypeFiltering::encodeValue'), 'required' => false, ), 'interval' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Intervals are used when creating a Series API call. The interval specifies the length of each sub-timeframe in a Series.', 'type' => 'string', 'required' => false, ), 'timezone' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'Modifies the timeframe filters for Relative Timeframes to match a specific timezone.', 'type' => 'number', 'required' => false, ), 'group_by' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The group_by parameter specifies the name of a property by which you would like to group the results.', 'type' => array('string', 'array'), 'filters' => array('KeenIO\Client\Filter\MultiTypeFiltering::encodeValue'), 'required' => false, ), 'percentile' => array( - 'location' => 'query', + 'location' => 'json', 'description' => 'The desired Xth percentile you want to get in your analysis.', 'type' => 'number', 'required' => true, diff --git a/tests/Tests/Client/KeenIOClientTest.php b/tests/Tests/Client/KeenIOClientTest.php index 60ac695..04b4a87 100755 --- a/tests/Tests/Client/KeenIOClientTest.php +++ b/tests/Tests/Client/KeenIOClientTest.php @@ -235,7 +235,7 @@ public function testServiceCommands($method, $params) //Resource Url $url = parse_url($request->getUri()); - parse_str($url['query'], $queryString); + $body = json_decode($request->getBody()->getContents(), true); //Camel to underscore case $method = strtolower(preg_replace('/([a-z])([A-Z])/', '$1_$2', $method)); @@ -251,9 +251,11 @@ public function testServiceCommands($method, $params) //Make sure the url has the right method $this->assertContains($method, explode('/', $url['path'])); - - //Check that the querystring has all the parameters - $this->assertEquals($params, $queryString); + //Check that the json body has all of the parameters + $this->assertEquals(count($params), count($body)); + foreach($params as $param => $value) { + $this->assertEquals($value, $body[$param]); + } // Make sure that the response is a PHP array, according to the documented return type $this->assertInternalType('array', $result);