Skip to content

Commit 3cc763a

Browse files
committed
Fixed geocoder service tests to use md5 cache keys
1 parent 0c513fe commit 3cc763a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/Feature/Providers/GeocoderServiceTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public function testGeocoder()
165165

166166
public function testCacheIsUsed()
167167
{
168-
$cacheKey = str_slug(strtolower(urlencode('1600 Pennsylvania Ave NW, Washington, DC 20500, USA')));
168+
$cacheKey = md5(str_slug(strtolower(urlencode('1600 Pennsylvania Ave NW, Washington, DC 20500, USA'))));
169169

170170
$result = app('geocoder')->geocode('1600 Pennsylvania Ave NW, Washington, DC 20500, USA')
171171
->get();
@@ -265,14 +265,14 @@ public function testGetProvider()
265265

266266
public function testJapaneseCharacterGeocoding()
267267
{
268-
$cacheKey = str_slug(strtolower(urlencode('108-0075 東京都港区港南2丁目16-3')));
268+
$cacheKey = md5(str_slug(strtolower(urlencode('108-0075 東京都港区港南2丁目16-3'))));
269269

270270
app('geocoder')->geocode('108-0075 東京都港区港南2丁目16-3')
271271
->get();
272272

273273
$this->assertEquals(
274274
$cacheKey,
275-
'108-0075e69db1e4baace983bde6b8afe58cbae6b8afe58d97efbc92e4b881e79baeefbc91efbc96efbc8defbc93'
275+
md5('108-0075e69db1e4baace983bde6b8afe58cbae6b8afe58d97efbc92e4b881e79baeefbc91efbc96efbc8defbc93')
276276
);
277277
$this->assertTrue(app('cache')->has("geocoder-{$cacheKey}"));
278278
}
@@ -304,7 +304,7 @@ public function testItHandlesOnlyCityAndState()
304304

305305
public function testEmptyResultsAreNotCached()
306306
{
307-
$cacheKey = str_slug(strtolower(urlencode('_')));
307+
$cacheKey = md5(str_slug(strtolower(urlencode('_'))));
308308

309309
Geocoder::geocode('_')->get();
310310

0 commit comments

Comments
 (0)