@@ -31,10 +31,7 @@ public function testPrefixRequestPath()
3131 'POST ' ,
3232 '/packages/?foo=bar ' ,
3333 [
34- 'PRIVATE-PACKAGIST-API-TOKEN ' => $ this ->token ,
35- 'PRIVATE-PACKAGIST-API-TIMESTAMP ' => $ this ->timestamp ,
36- 'PRIVATE-PACKAGIST-API-NONCE ' => $ this ->nonce ,
37- 'PRIVATE-PACKAGIST-API-SIGNATURE ' => 'a6wxBLYrmz4Mwmv/TKBZR5WHFcSCRbsny2frobJMt24= ' ,
34+ 'Authorization ' => ["PACKAGIST-HMAC-SHA256 Key= {$ this ->token }, Timestamp= {$ this ->timestamp }, Cnonce= {$ this ->nonce }, Signature=a6wxBLYrmz4Mwmv/TKBZR5WHFcSCRbsny2frobJMt24= " ],
3835 ],
3936 json_encode (['foo ' => 'bar ' ])
4037 );
@@ -48,19 +45,10 @@ public function testPrefixRequestPath()
4845 public function testPrefixRequestPathSmoke ()
4946 {
5047 $ request = new Request ('POST ' , '/packages/?foo=bar ' , [], json_encode (['foo ' => 'bar ' ]));
51- $ expected = [
52- 'PRIVATE-PACKAGIST-API-TOKEN ' ,
53- 'PRIVATE-PACKAGIST-API-TIMESTAMP ' ,
54- 'PRIVATE-PACKAGIST-API-NONCE ' ,
55- 'PRIVATE-PACKAGIST-API-SIGNATURE ' ,
56- ];
5748
5849 $ plugin = new RequestSignature ($ this ->token , $ this ->secret );
59- $ plugin ->handleRequest ($ request , function (Request $ actual ) use ($ expected ) {
60- $ headers = $ actual ->getHeaders ();
61- foreach ($ expected as $ header ) {
62- $ this ->assertNotNull ($ headers [$ header ][0 ]);
63- }
50+ $ plugin ->handleRequest ($ request , function (Request $ actual ) {
51+ $ this ->assertNotNull ($ actual ->getHeader ('Authorization ' )[0 ]);
6452 }, function () {
6553 });
6654 }
0 commit comments