11 Commits

Author SHA1 Message Date
Junade
67c34b789e Revert "MX records need ability to set priority" 2018-03-05 14:21:06 -06:00
Junade
9c56941516 Merge pull request #49 from darinrandal/add-priority-for-dns-creation
MX records need ability to set priority
2018-03-05 14:20:38 -06:00
Darin Randal
e18a64e7e4 MX records need ability to set priority 2018-03-05 11:38:18 -05:00
Junade
dc53414c2a Merge pull request #45 from darinrandal/master
Fix name of jumpstart zone add option to jump_start
2018-01-30 14:30:46 +13:00
Darin Randal
a628cac283 Update phpdoc to match camelCase variable 2018-01-23 10:09:36 -05:00
Darin Randal
0112425a61 Rename $jump_start to $jumpStart to follow camelCase conventions for variables 2018-01-23 10:08:40 -05:00
Darin Randal
fe854e1b21 Update zone tests to reflect correctly named jumpstart option 2018-01-23 10:01:51 -05:00
Darin Randal
45cb8ee539 Fix name of jumpstart zone add option to jump_start 2018-01-23 09:57:14 -05:00
Junade
cd2fd73cc3 Merge pull request #42 from JorgenPhi/master
AnalyticsDashboard params are not headers
2017-12-26 18:52:26 +00:00
Jorgen Phillips
bd83c6d48a Fix test 2017-12-24 12:48:22 -06:00
Jorgen Phillips
4e3d307bdd AnalyticsDashboard params are not headers
Also 'continuous' needs to be a string for the API to process it.
2017-12-24 12:41:38 -06:00
2 changed files with 8 additions and 8 deletions

View File

@@ -23,15 +23,15 @@ class Zones implements API
* @SuppressWarnings(PHPMD.BooleanArgumentFlag)
*
* @param string $name
* @param bool $jumpstart
* @param bool $jumpStart
* @param string $organizationID
* @return \stdClass
*/
public function addZone(string $name, bool $jumpstart = false, string $organizationID = ''): \stdClass
public function addZone(string $name, bool $jumpStart = false, string $organizationID = ''): \stdClass
{
$options = [
'name' => $name,
'jumpstart' => $jumpstart
'jump_start' => $jumpStart
];
if (!empty($organizationID)) {
@@ -114,7 +114,7 @@ class Zones implements API
*/
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;
}

View File

@@ -20,7 +20,7 @@ class ZonesTest extends TestCase
->with(
$this->equalTo('zones'),
$this->equalTo([]),
$this->equalTo(['name' => 'example.com', 'jumpstart' => false])
$this->equalTo(['name' => 'example.com', 'jump_start' => false])
);
$zones = new \Cloudflare\API\Endpoints\Zones($mock);
@@ -41,7 +41,7 @@ class ZonesTest extends TestCase
$this->equalTo([]),
$this->equalTo([
'name' => 'example.com',
'jumpstart' => true,
'jump_start' => true,
'organization' => (object)['id' => '01a7362d577a6c3019a474fd6f485823']
])
);
@@ -141,8 +141,8 @@ class ZonesTest extends TestCase
->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);