fix codestyle
This commit is contained in:
@@ -9,17 +9,17 @@ namespace Cloudflare\API\Auth;
|
|||||||
|
|
||||||
class APIToken implements Auth
|
class APIToken implements Auth
|
||||||
{
|
{
|
||||||
private $apiToken;
|
private $apiToken;
|
||||||
|
|
||||||
public function __construct(string $apiToken)
|
public function __construct(string $apiToken)
|
||||||
{
|
{
|
||||||
$this->apiToken = $apiToken;
|
$this->apiToken = $apiToken;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getHeaders(): array
|
public function getHeaders(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'Authorization' => 'Bearer ' . $this->apiToken
|
'Authorization' => 'Bearer ' . $this->apiToken
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,13 +9,13 @@ class APITokenTest extends TestCase
|
|||||||
{
|
{
|
||||||
public function testGetHeaders()
|
public function testGetHeaders()
|
||||||
{
|
{
|
||||||
$auth = new \Cloudflare\API\Auth\APIToken('zKq9RDO6PbCjs6PRUXF3BoqFi3QdwY36C2VfOaRy');
|
$auth = new \Cloudflare\API\Auth\APIToken('zKq9RDO6PbCjs6PRUXF3BoqFi3QdwY36C2VfOaRy');
|
||||||
$headers = $auth->getHeaders();
|
$headers = $auth->getHeaders();
|
||||||
|
|
||||||
$this->assertArrayHasKey('Authorization', $headers);
|
$this->assertArrayHasKey('Authorization', $headers);
|
||||||
|
|
||||||
$this->assertEquals('Bearer zKq9RDO6PbCjs6PRUXF3BoqFi3QdwY36C2VfOaRy', $headers['Authorization']);
|
$this->assertEquals('Bearer zKq9RDO6PbCjs6PRUXF3BoqFi3QdwY36C2VfOaRy', $headers['Authorization']);
|
||||||
|
|
||||||
$this->assertCount(1, $headers);
|
$this->assertCount(1, $headers);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user