Add changing TLS Zone Settings capability

This commit is contained in:
Marlin-Ops.com - Jurgen Coetsiers
2018-10-21 11:16:57 +02:00
parent 8c68295daa
commit 90e01ff095
3 changed files with 14 additions and 17 deletions

View File

@@ -0,0 +1,31 @@
<?php
/**
* Created by PhpStorm.
* User: Jurgen Coetsiers
* Date: 21/10/2018
* Time: 09:09
*/
class TLSTest extends TestCase
{
public function testEnableTLS13()
{
$response = $this->getPsr7JsonResponseForFixture('Endpoints/enableTLS13.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/tls_1_3'),
$this->equalTo(['value' => 'on'])
);
$ZoneTLSSettings = new \Cloudflare\API\Endpoints\TLS($mock);
$result = $ZoneTLSSettings->enableTLS13('c2547eb745079dac9320b638f5e225cf483cc5cfdda41', true);
$this->assertTrue($result);
}
}