HeaderListTest.php 514 B

123456789101112131415161718192021
  1. <?php
  2. namespace HttpSignatures\tests;
  3. use HttpSignatures\HeaderList;
  4. class HeaderListTest extends \PHPUnit_Framework_TestCase
  5. {
  6. public function testToString()
  7. {
  8. $hl = new HeaderList(['(request-target)', 'Date']);
  9. $this->assertEquals('(request-target) date', $hl->string());
  10. }
  11. public function testFromStringRoundTripNormalized()
  12. {
  13. $hl = HeaderList::fromString('(request-target) Accept');
  14. $this->assertEquals('(request-target) accept', $hl->string());
  15. }
  16. }