Merge branch '177-missing-support=for=custom-hostname-properties' of github.com:phily245/cloudflare-php into 177-missing-support=for=custom-hostname-properties

This commit is contained in:
Phil Young
2021-06-22 10:52:32 +01:00
3 changed files with 50 additions and 0 deletions

View File

@@ -175,6 +175,26 @@ class CustomHostnamesTest extends TestCase
$this->assertEquals('0d89c70d-ad9f-4843-b99f-6cc0252067e9', $zones->getBody()->id);
}
public function testGetHostnameFallbackOrigin()
{
$response = $this->getPsr7JsonResponseForFixture('Endpoints/getCustomHostnameFallbackOrigin.json');
$mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock();
$mock->method('get')->willReturn($response);
$mock->expects($this->once())
->method('get')
->with(
$this->equalTo('zones/023e105f4ecef8ad9ca31a8372d0c353/custom_hostnames/fallback_origin')
);
$zones = new \Cloudflare\API\Endpoints\CustomHostnames($mock);
$result = $zones->getFallbackOrigin('023e105f4ecef8ad9ca31a8372d0c353');
$this->assertObjectHasAttribute('origin', $result);
$this->assertObjectHasAttribute('status', $result);
}
private function getCustomSsl(): array
{
$customKey = <<<KEY