[RFR]: Added Origin CA Certificate endpoint (#123)
* Added Certificate endpoint * Implement all calls in /certificates endpoint * Added to travis more php versions * Fix package compatibility * Added CertificateTest * Added test for Certificate endpoint * Added more tests * Updated README Co-authored-by: haphan <thanhha.phan@myrepublic.net>
This commit is contained in:
22
tests/Configurations/CertificateTest.php
Normal file
22
tests/Configurations/CertificateTest.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Cloudflare\API\Configurations\Certificate;
|
||||
|
||||
class CertificateTest extends TestCase
|
||||
{
|
||||
public function testGetArray()
|
||||
{
|
||||
$certificate = new Certificate();
|
||||
$certificate->setHostnames(['foo.com', '*.bar.com']);
|
||||
$certificate->setRequestType(Certificate::ORIGIN_ECC);
|
||||
$certificate->setRequestedValidity(365);
|
||||
$certificate->setCsr('some-csr-encoded-text');
|
||||
|
||||
$array = $certificate->getArray();
|
||||
$this->assertEquals(['foo.com', '*.bar.com'], $array['hostnames']);
|
||||
$this->assertEquals('origin-ecc', $array['request_type']);
|
||||
$this->assertEquals(365, $array['requested_validity']);
|
||||
$this->assertEquals('some-csr-encoded-text', $array['csr']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user