Skip to content

Commit

Permalink
Merge pull request #42 from JorgenPhi/master
Browse files Browse the repository at this point in the history
AnalyticsDashboard params are not headers
  • Loading branch information
IcyApril authored Dec 26, 2017
2 parents 99d89e7 + bd83c6d commit cd2fd73
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Endpoints/Zones.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function getZoneID(string $name = ''): string
*/
public function getAnalyticsDashboard(string $zoneID, string $since = '-10080', string $until = '0', bool $continuous = true): \stdClass
{
$response = $this->adapter->get('zones/' . $zoneID . '/analytics/dashboard', [], ['since' => $since, 'until' => $until, 'continuous' => $continuous]);
$response = $this->adapter->get('zones/' . $zoneID . '/analytics/dashboard', ['since' => $since, 'until' => $until, 'continuous' => var_export($continuous, true)], []);

return json_decode($response->getBody())->result;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Endpoints/ZonesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ public function testGetAnalyticsDashboard()
->method('get')
->with(
$this->equalTo('zones/c2547eb745079dac9320b638f5e225cf483cc5cfdda41/analytics/dashboard'),
$this->equalTo([]),
$this->equalTo(['since' => '-10080', 'until' => '0', 'continuous' => true])
$this->equalTo(['since' => '-10080', 'until' => '0', 'continuous' => var_export(true, true)]),
$this->equalTo([])
);

$zones = new \Cloudflare\API\Endpoints\Zones($mock);
Expand Down

0 comments on commit cd2fd73

Please sign in to comment.