Updated TLS.php and added new endpoints to new ZoneSettings.php
This commit is contained in:
23
tests/Auth/APIKeyTest.php
Normal file
23
tests/Auth/APIKeyTest.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* User: junade
|
||||
* Date: 13/01/2017
|
||||
* Time: 17:15
|
||||
*/
|
||||
class APIKeyTest extends TestCase
|
||||
{
|
||||
public function testGetHeaders()
|
||||
{
|
||||
$auth = new \Cloudflare\API\Auth\APIKey('example@example.com', '1234567893feefc5f0q5000bfo0c38d90bbeb');
|
||||
$headers = $auth->getHeaders();
|
||||
|
||||
$this->assertArrayHasKey('X-Auth-Key', $headers);
|
||||
$this->assertArrayHasKey('X-Auth-Email', $headers);
|
||||
|
||||
$this->assertEquals('example@example.com', $headers['X-Auth-Email']);
|
||||
$this->assertEquals('1234567893feefc5f0q5000bfo0c38d90bbeb', $headers['X-Auth-Key']);
|
||||
|
||||
$this->assertCount(2, $headers);
|
||||
}
|
||||
}
|
||||
18
tests/Auth/NoneTest.php
Normal file
18
tests/Auth/NoneTest.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: junade
|
||||
* Date: 04/09/2017
|
||||
* Time: 20:08
|
||||
*/
|
||||
|
||||
class NoneTest extends TestCase
|
||||
{
|
||||
public function testGetHeaders()
|
||||
{
|
||||
$auth = new \Cloudflare\API\Auth\None();
|
||||
$headers = $auth->getHeaders();
|
||||
|
||||
$this->assertEquals([], $headers);
|
||||
}
|
||||
}
|
||||
24
tests/Auth/UserServiceKeyTest.php
Normal file
24
tests/Auth/UserServiceKeyTest.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* User: junade
|
||||
* Date: 13/01/2017
|
||||
* Time: 18:03
|
||||
*/
|
||||
class UserServiceKeyTest extends TestCase
|
||||
{
|
||||
public function testGetHeaders()
|
||||
{
|
||||
$auth = new \Cloudflare\API\Auth\UserServiceKey('v1.0-e24fd090c02efcfecb4de8f4ff246fd5c75b48946fdf0ce26c59f91d0d90797b-cfa33fe60e8e34073c149323454383fc9005d25c9b4c502c2f063457ef65322eade065975001a0b4b4c591c5e1bd36a6e8f7e2d4fa8a9ec01c64c041e99530c2-07b9efe0acd78c82c8d9c690aacb8656d81c369246d7f996a205fe3c18e9254a');
|
||||
$headers = $auth->getHeaders();
|
||||
|
||||
$this->assertArrayHasKey('X-Auth-User-Service-Key', $headers);
|
||||
|
||||
$this->assertEquals(
|
||||
'v1.0-e24fd090c02efcfecb4de8f4ff246fd5c75b48946fdf0ce26c59f91d0d90797b-cfa33fe60e8e34073c149323454383fc9005d25c9b4c502c2f063457ef65322eade065975001a0b4b4c591c5e1bd36a6e8f7e2d4fa8a9ec01c64c041e99530c2-07b9efe0acd78c82c8d9c690aacb8656d81c369246d7f996a205fe3c18e9254a',
|
||||
$headers['X-Auth-User-Service-Key']
|
||||
);
|
||||
|
||||
$this->assertCount(1, $headers);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user