add api token support

This commit is contained in:
Martin Pecha
2019-07-30 23:06:59 +02:00
parent 9b9738910d
commit 6a80cb69e2
2 changed files with 46 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
<?php
/**
* User: junade
* Date: 13/01/2017
* Time: 17:15
*/
class APITokenTest extends TestCase
{
public function testGetHeaders()
{
$auth = new \Cloudflare\API\Auth\APIToken('zKq9RDO6PbCjs6PRUXF3BoqFi3QdwY36C2VfOaRy');
$headers = $auth->getHeaders();
$this->assertArrayHasKey('Authorization', $headers);
$this->assertEquals('Bearer zKq9RDO6PbCjs6PRUXF3BoqFi3QdwY36C2VfOaRy', $headers['Authorization']);
$this->assertCount(1, $headers);
}
}