@@ -94,7 +94,7 @@ public function testSetsTheXContentDigestResponseHeaderBeforeStoring()
9494 $ entries = $ this ->getStoreMetadata ($ cacheKey );
9595 [, $ res ] = $ entries [0 ];
9696
97- $ this ->assertEquals ('en9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 ' , $ res ['x-content-digest ' ][0 ]);
97+ $ this ->assertEquals ('en6c78e0e3bd51d358d01e758642b85fb8 ' , $ res ['x-content-digest ' ][0 ]);
9898 }
9999
100100 public function testDoesNotTrustXContentDigestFromUpstream ()
@@ -105,8 +105,8 @@ public function testDoesNotTrustXContentDigestFromUpstream()
105105 $ entries = $ this ->getStoreMetadata ($ cacheKey );
106106 [, $ res ] = $ entries [0 ];
107107
108- $ this ->assertEquals ('en9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 ' , $ res ['x-content-digest ' ][0 ]);
109- $ this ->assertEquals ('en9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 ' , $ response ->headers ->get ('X-Content-Digest ' ));
108+ $ this ->assertEquals ('en6c78e0e3bd51d358d01e758642b85fb8 ' , $ res ['x-content-digest ' ][0 ]);
109+ $ this ->assertEquals ('en6c78e0e3bd51d358d01e758642b85fb8 ' , $ response ->headers ->get ('X-Content-Digest ' ));
110110 }
111111
112112 public function testWritesResponseEvenIfXContentDigestIsPresent ()
@@ -198,7 +198,7 @@ public function testRestoresResponseContentFromEntityStoreWithLookup()
198198 {
199199 $ this ->storeSimpleEntry ();
200200 $ response = $ this ->store ->lookup ($ this ->request );
201- $ this ->assertEquals ($ this ->getStorePath ('en ' .hash ('sha256 ' , 'test ' )), $ response ->getContent ());
201+ $ this ->assertEquals ($ this ->getStorePath ('en ' .hash ('xxh128 ' , 'test ' )), $ response ->getContent ());
202202 }
203203
204204 public function testInvalidatesMetaAndEntityStoreEntriesWithInvalidate ()
@@ -251,9 +251,9 @@ public function testStoresMultipleResponsesForEachVaryCombination()
251251 $ res3 = new Response ('test 3 ' , 200 , ['Vary ' => 'Foo Bar ' ]);
252252 $ this ->store ->write ($ req3 , $ res3 );
253253
254- $ this ->assertEquals ($ this ->getStorePath ('en ' .hash ('sha256 ' , 'test 3 ' )), $ this ->store ->lookup ($ req3 )->getContent ());
255- $ this ->assertEquals ($ this ->getStorePath ('en ' .hash ('sha256 ' , 'test 2 ' )), $ this ->store ->lookup ($ req2 )->getContent ());
256- $ this ->assertEquals ($ this ->getStorePath ('en ' .hash ('sha256 ' , 'test 1 ' )), $ this ->store ->lookup ($ req1 )->getContent ());
254+
7440
$ this ->assertEquals ($ this ->getStorePath ('en ' .hash ('xxh128 ' , 'test 3 ' )), $ this ->store ->lookup ($ req3 )->getContent ());
255+ $ this ->assertEquals ($ this ->getStorePath ('en ' .hash ('xxh128 ' , 'test 2 ' )), $ this ->store ->lookup ($ req2 )->getContent ());
256+ $ this ->assertEquals ($ this ->getStorePath ('en ' .hash ('xxh128 ' , 'test 1 ' )), $ this ->store ->lookup ($ req1 )->getContent ());
257257
258258 $ this ->assertCount (3 , $ this ->getStoreMetadata ($ key ));
259259 }
@@ -263,17 +263,17 @@ public function testOverwritesNonVaryingResponseWithStore()
263263 $ req1 = Request::create ('/test ' , 'get ' , [], [], [], ['HTTP_FOO ' => 'Foo ' , 'HTTP_BAR ' => 'Bar ' ]);
264264 $ res1 = new Response ('test 1 ' , 200 , ['Vary ' => 'Foo Bar ' ]);
265265 $ this ->store ->write ($ req1 , $ res1 );
266- $ this ->assertEquals ($ this ->getStorePath ('en ' .hash ('sha256 ' , 'test 1 ' )), $ this ->store ->lookup ($ req1 )->getContent ());
266+ $ this ->assertEquals ($ this ->getStorePath ('en ' .hash ('xxh128 ' , 'test 1 ' )), $ this ->store ->lookup ($ req1 )->getContent ());
267267
268268 $ req2 = Request::create ('/test ' , 'get ' , [], [], [], ['HTTP_FOO ' => 'Bling ' , 'HTTP_BAR ' => 'Bam ' ]);
269269 $ res2 = new Response ('test 2 ' , 200 , ['Vary ' => 'Foo Bar ' ]);
270270 $ this ->store ->write ($ req2 , $ res2 );
271- $ this ->assertEquals ($ this ->getStorePath ('en ' .hash ('sha256 ' , 'test 2 ' )), $ this ->store ->lookup ($ req2 )->getContent ());
271+ $ this ->assertEquals ($ this ->getStorePath ('en ' .hash ('xxh128 ' , 'test 2 ' )), $ this ->store ->lookup ($ req2 )->getContent ());
272272
273273 $ req3 = Request::create ('/test ' , 'get ' , [], [], [], ['HTTP_FOO ' => 'Foo ' , 'HTTP_BAR ' => 'Bar ' ]);
274274 $ res3 = new Response ('test 3 ' , 200 , ['Vary ' => 'Foo Bar ' ]);
275275 $ key = $ this ->store ->write ($ req3 , $ res3 );
276- $ this ->assertEquals ($ this ->getStorePath ('en ' .hash ('sha256 ' , 'test 3 ' )), $ this ->store ->lookup ($ req3 )->getContent ());
276+ $ this ->assertEquals ($ this ->getStorePath ('en ' .hash ('xxh128 ' , 'test 3 ' )), $ this ->store ->lookup ($ req3 )->getContent ());
277277
278278 $ this ->assertCount (2 , $ this ->getStoreMetadata ($ key ));
279279 }
0 commit comments