22
33namespace InteractionDesignFoundation \GeoIP \Tests ;
44
5+ use Illuminate \Cache \CacheManager ;
56use Mockery ;
67
78class CacheTest extends TestCase
@@ -16,14 +17,15 @@ public function shouldReturnValidLocation()
1617 'lon ' => -72.92 ,
1718 ];
1819
19- $ cacheMock = Mockery::mock (' Illuminate\Cache\ CacheManager' )
20+ $ cacheMock = Mockery::mock (CacheManager::class )
2021 ->shouldAllowMockingProtectedMethods ();
2122
2223 $ cacheMock ->shouldReceive ('get ' )
2324 ->with ($ data ['ip ' ])
2425 ->andReturn ($ data );
2526
2627 $ geo_ip = $ this ->makeGeoIP ([], $ cacheMock );
28+ $ geo_ip ->getCache ()->setPrefix ('' );
2729
2830 $ location = $ geo_ip ->getCache ()->get ($ data ['ip ' ]);
2931
@@ -35,10 +37,11 @@ public function shouldReturnValidLocation()
3537 /** @test */
3638 public function shouldReturnInvalidLocation ()
3739 {
38- $ cacheMock = Mockery::mock (' Illuminate\Cache\ CacheManager' )
40+ $ cacheMock = Mockery::mock (CacheManager::class )
3941 ->shouldAllowMockingProtectedMethods ();
4042
4143 $ geo_ip = $ this ->makeGeoIP ([], $ cacheMock );
44+ $ geo_ip ->getCache ()->setPrefix ('' );
4245
4346 $ cacheMock ->shouldReceive ('get ' )
4447 ->with ('81.2.69.142 ' )
@@ -61,10 +64,11 @@ public function shouldSetLocation()
6164 'lon ' => -72.92 ,
6265 ]);
6366
64- $ cacheMock = Mockery::mock (' Illuminate\Cache\ CacheManager' )
67+ $ cacheMock = Mockery::mock (CacheManager::class )
6568 ->shouldAllowMockingProtectedMethods ();
6669
6770 $ geo_ip = $ this ->makeGeoIP ([], $ cacheMock );
71+ $ geo_ip ->getCache ()->setPrefix ('' );
6872
6973 $ cacheMock ->shouldReceive ('put ' )
7074 ->withArgs (['81.2.69.142 ' , $ location ->toArray (), $ geo_ip ->config ('cache_expires ' )])
@@ -80,7 +84,7 @@ public function shouldSetLocation()
8084 /** @test */
8185 public function shouldFlushLocations ()
8286 {
83- $ cacheMock = Mockery::mock (' Illuminate\Cache\ CacheManager' )
87+ $ cacheMock = Mockery::mock (CacheManager::class )
8488 ->shouldAllowMockingProtectedMethods ();
8589
8690 $ geo_ip = $ this ->makeGeoIP ([], $ cacheMock );
0 commit comments