@@ -507,7 +507,24 @@ public function testErrorMessage()
507
507
$ this ->assertEquals ('HTTP/1.1 401 Unauthorized ' , $ test ->curl ->error_message );
508
508
}
509
509
510
- public function testHeaders ()
510
+ public function testRequestHeaderCaseSensitivity ()
511
+ {
512
+ $ content_type = 'application/json ' ;
513
+ $ curl = new Curl ();
514
+ $ curl ->setHeader ('Content-Type ' , $ content_type );
515
+
516
+ $ reflector = new ReflectionClass ('\Curl\Curl ' );
517
+ $ property = $ reflector ->getProperty ('headers ' );
518
+ $ property ->setAccessible (true );
519
+ $ headers = $ property ->getValue ($ curl );
520
+
521
+ $ this ->assertEquals ($ content_type , $ headers ['Content-Type ' ]);
522
+ $ this ->assertEquals ($ content_type , $ headers ['content-type ' ]);
523
+ $ this ->assertEquals ($ content_type , $ headers ['CONTENT-TYPE ' ]);
524
+ $ this ->assertEquals ($ content_type , $ headers ['cOnTeNt-TyPe ' ]);
525
+ }
526
+
527
+ public function testResponseHeaders ()
511
528
{
512
529
$ test = new Test ();
513
530
$ test ->curl ->setHeader ('Content-Type ' , 'application/json ' );
@@ -518,7 +535,7 @@ public function testHeaders()
518
535
$ this ->assertEquals ('application/json ' , $ test ->server ('server ' , 'GET ' , array ('key ' => 'HTTP_ACCEPT ' )));
519
536
}
520
537
521
- public function testHeaderCaseSensitivity ()
538
+ public function testResponseHeaderCaseSensitivity ()
522
539
{
523
540
$ content_type = 'application/json ' ;
524
541
$ test = new Test ();
0 commit comments