Add changing TLS Zone Settings capability
This commit is contained in:
@@ -44,6 +44,10 @@ class TLS implements API
|
|||||||
);
|
);
|
||||||
$body = json_decode($return->getBody());
|
$body = json_decode($return->getBody());
|
||||||
|
|
||||||
return $body->result;
|
if ($body->success) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,4 +28,24 @@ class TLSTest extends TestCase
|
|||||||
|
|
||||||
$this->assertTrue($result);
|
$this->assertTrue($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testChangeMinimimTLSVersion()
|
||||||
|
{
|
||||||
|
$response = $this->getPsr7JsonResponseForFixture('Endpoints/changeMinimumTLSVersion.json');
|
||||||
|
|
||||||
|
$mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock();
|
||||||
|
$mock->method('patch')->willReturn($response);
|
||||||
|
|
||||||
|
$mock->expects($this->once())
|
||||||
|
->method('patch')
|
||||||
|
->with(
|
||||||
|
$this->equalTo('zones/c2547eb745079dac9320b638f5e225cf483cc5cfdda41/settings/min_tls_version'),
|
||||||
|
$this->equalTo(['value' => '1.1'])
|
||||||
|
);
|
||||||
|
|
||||||
|
$ZoneTLSSettings = new \Cloudflare\API\Endpoints\TLS($mock);
|
||||||
|
$result = $ZoneTLSSettings->changeMinimumTLSVersion('c2547eb745079dac9320b638f5e225cf483cc5cfdda41', '1.1');
|
||||||
|
|
||||||
|
$this->assertTrue($result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,5 +2,5 @@
|
|||||||
"success": true,
|
"success": true,
|
||||||
"errors": [],
|
"errors": [],
|
||||||
"messages": [],
|
"messages": [],
|
||||||
"result": "1.0"
|
"result": "1.1"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user