@@ -14,6 +14,7 @@ public function testGetGeocodedData()
1414 {
1515 $ address = 'Paris, France ' ;
1616 $ coordinates = array ('lat ' => 48.857049 ,'lng ' => 2.35223 );
17+ $ cacheKey = 'geocoder_ ' . sha1 ($ address );
1718
1819 $ delegate = $ this ->getMock ('Geocoder \\Provider \\ProviderInterface ' );
1920 $ delegate ->expects ($ this ->once ())
@@ -24,12 +25,12 @@ public function testGetGeocodedData()
2425 $ cache = $ this ->getMock ('Doctrine \\Common \\Cache \\Cache ' );
2526 $ cache ->expects ($ this ->once ())
2627 ->method ('fetch ' )
27- ->with (crc32 ( $ address ) )
28+ ->with ($ cacheKey )
2829 ->will ($ this ->returnValue (false ));
2930
3031 $ cache ->expects ($ this ->once ())
3132 ->method ('save ' )
32- ->with (crc32 ( $ address ) , serialize ($ coordinates ), 0 );
33+ ->with ($ cacheKey , serialize ($ coordinates ), 0 );
3334
3435 $ provider = new CacheProvider ($ cache , $ delegate );
3536 $ this ->assertEquals ($ coordinates , $ provider ->getGeocodedData ($ address ));
@@ -39,6 +40,7 @@ public function testGetCachedGeocodedData()
3940 {
4041 $ address = 'Paris, France ' ;
4142 $ coordinates = array ('lat ' => 48.857049 ,'lng ' => 2.35223 );
43+ $ cacheKey = 'geocoder_ ' . sha1 ($ address );
4244
4345 $ delegate = $ this ->getMock ('Geocoder \\Provider \\ProviderInterface ' );
4446 $ delegate ->expects ($ this ->once ())
@@ -51,7 +53,7 @@ public function testGetCachedGeocodedData()
5153 $ provider ->getGeocodedData ($ address );
5254 $ provider ->getGeocodedData ($ address );
5355
54- $ this ->assertTrue ($ cache ->contains (crc32 ( $ address ) ));
56+ $ this ->assertTrue ($ cache ->contains ($ cacheKey ));
5557 }
5658
5759 public function testGetReversedData ()
0 commit comments