Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
18 | public function testGetCountryMaxmindGeoIPBundleInstalled() |
||
19 | { |
||
20 | if (class_exists("Maxmind\lib\GeoIp")) { |
||
21 | $container = $this->getMockBuilder("Symfony\Component\DependencyInjection\ContainerInterface")->getMock(); |
||
22 | $container->expects($this->once())->method("hasParameter")->with('maxmind_geoip_data_file_path')->will($this->returnValue(__DIR__."/GeoLiteCity.dat")); |
||
23 | $container->expects($this->once())->method("getParameter")->with('maxmind_geoip_data_file_path')->will($this->returnValue(__DIR__."/GeoLiteCity.dat")); |
||
24 | $adapter = new MaxmindLookupAdapter($container); |
||
25 | $country = $adapter->getCountry("8.8.8.8"); |
||
26 | $this->assertEquals("US", $country); |
||
27 | } else { |
||
28 | $this->markTestSkipped('The MaxMind library seems not to be installed/available.'); |
||
29 | } |
||
30 | } |
||
31 | } |
||
32 |