@@ -25,9 +25,8 @@ public function should_return_valid_location()
2525 $ cacheMock = Mockery::mock (CacheManager::class)
2626 ->shouldAllowMockingProtectedMethods ();
2727
28- $ cacheMock ->shouldReceive ('get ' )
29- ->with ($ data ['ip ' ])
30- ->andReturn ($ data );
28+ $ cacheMock ->shouldReceive ('supportsTags ' )->andReturn (false );
29+ $ cacheMock ->shouldReceive ('get ' )->with ($ data ['ip ' ])->andReturn ($ data );
3130
3231 $ geo_ip = $ this ->makeGeoIP ([], $ cacheMock );
3332 $ geo_ip ->getCache ()->setPrefix ('' );
@@ -45,16 +44,12 @@ public function should_return_invalid_location()
4544 $ cacheMock = Mockery::mock (CacheManager::class)
4645 ->shouldAllowMockingProtectedMethods ();
4746
47+ $ cacheMock ->shouldReceive ('supportsTags ' )->andReturn (false );
48+
4849 $ geo_ip = $ this ->makeGeoIP ([], $ cacheMock );
4950 $ geo_ip ->getCache ()->setPrefix ('' );
5051
51- $ cacheMock ->shouldReceive ('get ' )
52- ->with ('81.2.69.142 ' )
53- ->andReturn (null );
54-
55- $ cacheMock ->shouldReceive ('tags ' )
56- ->with ($ geo_ip ->config ('cache_tags ' ))
57- ->andReturnSelf ();
52+ $ cacheMock ->shouldReceive ('get ' )->with ('81.2.69.142 ' )->andReturn (null );
5853
5954 $ this ->assertSame ($ geo_ip ->getCache ()->get ('81.2.69.142 ' ), null );
6055 }
@@ -72,12 +67,12 @@ public function should_set_location()
7267 $ cacheMock = Mockery::mock (CacheManager::class)
7368 ->shouldAllowMockingProtectedMethods ();
7469
70+ $ cacheMock ->shouldReceive ('supportsTags ' )->andReturn (false );
71+
7572 $ geo_ip = $ this ->makeGeoIP ([], $ cacheMock );
7673 $ geo_ip ->getCache ()->setPrefix ('' );
7774
78- $ cacheMock ->shouldReceive ('put ' )
79- ->withArgs (['81.2.69.142 ' , $ location ->toArray (), $ geo_ip ->config ('cache_expires ' )])
80- ->andReturn (null );
75+ $ cacheMock ->shouldReceive ('put ' )->withArgs (['81.2.69.142 ' , $ location ->toArray (), $ geo_ip ->config ('cache_expires ' )])->andReturn (null );
8176
8277 $ cacheMock ->shouldReceive ('tags ' )
8378 ->with ($ geo_ip ->config ('cache_tags ' ))
@@ -94,12 +89,10 @@ public function should_flush_locations()
9489
9590 $ geo_ip = $ this ->makeGeoIP ([], $ cacheMock );
9691
97- $ cacheMock ->shouldReceive ('flush ' )
98- ->andReturn (true );
92+ $ cacheMock ->shouldReceive ('flush ' )->andReturn (true );
9993
100- $ cacheMock ->shouldReceive ('tags ' )
101- ->with ($ geo_ip ->config ('cache_tags ' ))
102- ->andReturnSelf ();
94+ $ cacheMock ->shouldReceive ('tags ' )->with ($ geo_ip ->config ('cache_tags ' ))->andReturnSelf ();
95+ $ cacheMock ->shouldReceive ('tags ' )->with ($ geo_ip ->config ('cache_tags ' ))->andReturnSelf ();
10396
10497 $ this ->assertSame ($ geo_ip ->getCache ()->flush (), true );
10598 }
0 commit comments