APIKeyTest.php 643 B

123456789101112131415161718192021222324
  1. <?php
  2. /**
  3. * User: junade
  4. * Date: 13/01/2017
  5. * Time: 17:15
  6. */
  7. class APIKeyTest extends TestCase
  8. {
  9. public function testGetHeaders()
  10. {
  11. $auth = new \Cloudflare\API\Auth\APIKey('example@example.com', '1234567893feefc5f0q5000bfo0c38d90bbeb');
  12. $headers = $auth->getHeaders();
  13. $this->assertArrayHasKey('X-Auth-Key', $headers);
  14. $this->assertArrayHasKey('X-Auth-Email', $headers);
  15. $this->assertEquals('example@example.com', $headers['X-Auth-Email']);
  16. $this->assertEquals('1234567893feefc5f0q5000bfo0c38d90bbeb', $headers['X-Auth-Key']);
  17. $this->assertCount(2, $headers);
  18. }
  19. }