diff --git a/tests/Endpoints/CustomHostnamesTest.php b/tests/Endpoints/CustomHostnamesTest.php index 276776c..f3fae3d 100644 --- a/tests/Endpoints/CustomHostnamesTest.php +++ b/tests/Endpoints/CustomHostnamesTest.php @@ -17,61 +17,7 @@ class CustomHostnamesTest extends TestCase $mock = $this->getMockBuilder(\Cloudflare\API\Adapter\Adapter::class)->getMock(); $mock->method('post')->willReturn($response); - $customKey = <<getCustomSsl(); $mock->expects($this->once()) ->method('post') @@ -89,8 +35,8 @@ CERTIFICATE; 'min_tls_version' => '1.2', ], 'bundle_method' => 'optimal', - 'custom_key' => $customKey, - 'custom_certificate' => $customCertificate, + 'custom_key' => $customSsl['key'], + 'custom_certificate' => $customSsl['certificate'], 'wildcard' => true, ], ]) @@ -112,10 +58,7 @@ CERTIFICATE; 'origin.example.com', true, 'optimal', - [ - 'key' => $customKey, - 'certificate' => $customCertificate, - ] + $customSsl ); $this->assertEquals('0d89c70d-ad9f-4843-b99f-6cc0252067e9', $hostname->getBody()->result->id); } @@ -231,4 +174,68 @@ CERTIFICATE; $this->assertEquals('0d89c70d-ad9f-4843-b99f-6cc0252067e9', $result->id); $this->assertEquals('0d89c70d-ad9f-4843-b99f-6cc0252067e9', $zones->getBody()->id); } + + private function getCustomSsl(): array + { + $customKey = << $customKey, + 'certificate' => $customCertificate, + ]; + } }