@@ -94,7 +94,7 @@ public function testSetsTheXContentDigestResponseHeaderBeforeStoring()
94
94
$ entries = $ this ->getStoreMetadata ($ cacheKey );
95
95
[, $ res ] = $ entries [0 ];
96
96
97
- $ this ->assertEquals ('en9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 ' , $ res ['x-content-digest ' ][0 ]);
97
+ $ this ->assertEquals ('en6c78e0e3bd51d358d01e758642b85fb8 ' , $ res ['x-content-digest ' ][0 ]);
98
98
}
99
99
100
100
public function testDoesNotTrustXContentDigestFromUpstream ()
@@ -105,8 +105,8 @@ public function testDoesNotTrustXContentDigestFromUpstream()
105
105
$ entries = $ this ->getStoreMetadata ($ cacheKey );
106
106
[, $ res ] = $ entries [0 ];
107
107
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 ' ));
110
110
}
111
111
112
112
public function testWritesResponseEvenIfXContentDigestIsPresent ()
@@ -198,7 +198,7 @@ public function testRestoresResponseContentFromEntityStoreWithLookup()
198
198
{
199
199
$ this ->storeSimpleEntry ();
200
200
$ 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 ());
202
202
}
203
203
204
204
public function testInvalidatesMetaAndEntityStoreEntriesWithInvalidate ()
@@ -251,9 +251,9 @@ public function testStoresMultipleResponsesForEachVaryCombination()
251
251
$ res3 = new Response ('test 3 ' , 200 , ['Vary ' => 'Foo Bar ' ]);
252
252
$ this ->store ->write ($ req3 , $ res3 );
253
253
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
+ $ 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 ());
257
257
258
258
$ this ->assertCount (3 , $ this ->getStoreMetadata ($ key ));
259
259
}
@@ -263,17 +263,17 @@ public function testOverwritesNonVaryingResponseWithStore()
263
263
$ req1 = Request::create ('/test ' , 'get ' , [], [], [], ['HTTP_FOO ' => 'Foo ' , 'HTTP_BAR ' => 'Bar ' ]);
264
264
$ res1 = new Response ('test 1 ' , 200 , ['Vary ' => 'Foo Bar ' ]);
265
265
$ 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 ());
267
267
268
268
$ req2 = Request::create ('/test ' , 'get ' , [], [], [], ['HTTP_FOO ' => 'Bling ' , 'HTTP_BAR ' => 'Bam ' ]);
269
269
$ res2 = new Response ('test 2 ' , 200 , ['Vary ' => 'Foo Bar ' ]);
270
270
$ 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 ());
272
272
273
273
$ req3 = Request::create ('/test ' , 'get ' , [], [], [], ['HTTP_FOO ' => 'Foo ' , 'HTTP_BAR ' => 'Bar ' ]);
274
274
$ res3 = new Response ('test 3 ' , 200 , ['Vary ' => 'Foo Bar ' ]);
275
275
$ 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 ());
277
277
278
278
$ this ->assertCount (2 , $ this ->getStoreMetadata ($ key ));
279
279
}
0 commit comments