Normalizing headers to a Ucfirst-With-Dashes format.

This commit is contained in:
Dave Widmer
2013-08-20 11:40:02 -04:00
parent 879d98abfb
commit 69710a5909
2 changed files with 52 additions and 1 deletions

View File

@@ -59,6 +59,20 @@ class Request_test extends PHPUnit_Framework_TestCase
$this->assertEquals(array('Host' => 'foobar.com'), $this->request->header());
}
function test_canonical_header()
{
$request = new League\OAuth2\Server\Util\Request(
array('foo' => 'bar'),
array('foo' => 'bar'),
array('foo' => 'bar'),
array('foo' => 'bar'),
array('HTTP_HOST' => 'foobar.com'),
array('authorization' => 'Bearer ajdfkljadslfjasdlkj')
);
$this->assertEquals('Bearer ajdfkljadslfjasdlkj', $request->header('Authorization'));
}
/**
* @expectedException InvalidArgumentException
*/