55namespace InteractionDesignFoundation \GeoIP \Tests ;
66
77use Illuminate \Cache \CacheManager ;
8+ use InteractionDesignFoundation \GeoIP \GeoIP ;
89use Mockery ;
910use PHPUnit \Framework \TestCase as PHPUnitTestCase ;
1011
@@ -25,7 +26,7 @@ protected function tearDown(): void
2526 Mockery::close ();
2627 }
2728
28- protected function makeGeoIP (array $ config = [], $ cacheMock = null )
29+ protected function makeGeoIP (array $ config = [], $ cacheMock = null ): GeoIP
2930 {
3031 $ cacheMock = $ cacheMock ?: Mockery::mock (CacheManager::class);
3132 $ cacheMock ->shouldReceive ('supportsTags ' )->andReturn (false );
@@ -34,10 +35,10 @@ protected function makeGeoIP(array $config = [], $cacheMock = null)
3435
3536 $ cacheMock ->shouldReceive ('tags ' )->with (['laravel-geoip-location ' ])->andReturnSelf ();
3637
37- return new \ InteractionDesignFoundation \ GeoIP \ GeoIP ($ config , $ cacheMock );
38+ return new GeoIP ($ config , $ cacheMock );
3839 }
3940
40- protected function getConfig ()
41+ protected function getConfig (): array
4142 {
4243 $ config = include (__DIR__ . '/../config/geoip.php ' );
4344
@@ -46,17 +47,12 @@ protected function getConfig()
4647 return $ config ;
4748 }
4849
49- /**
50- * Check for test database and make a copy of it
51- * if it does not exist.
52- *
53- * @param string $database
54- */
55- protected function databaseCheck ($ database )
50+ /** Check for a test database and make a copy of it if it does not exist.*/
51+ protected function databaseCheck (string $ databaseFilepath ): void
5652 {
57- if (file_exists ($ database ) === false ) {
58- @mkdir (dirname ($ database ), 0755 , true );
59- copy (__DIR__ . '/../resources/geoip.mmdb ' , $ database );
53+ if (file_exists ($ databaseFilepath ) === false ) {
54+ @mkdir (dirname ($ databaseFilepath ), 0755 , true );
55+ copy (__DIR__ . '/../resources/geoip.mmdb ' , $ databaseFilepath );
6056 }
6157 }
6258}
0 commit comments