| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | public function testGetCountry() |
||
| 9 | { |
||
| 10 | if (function_exists("geoip_country_code_by_name")) { |
||
| 11 | $adapter = new DefaultLookupAdapter(); |
||
| 12 | |||
| 13 | $chIp = "194.150.248.201"; |
||
| 14 | $this->assertEquals("CH",$adapter->getCountry($chIp), "$chIp should be in Switzerland => CH"); |
||
| 15 | |||
| 16 | $usIp = "8.8.8.8"; |
||
| 17 | $this->assertEquals("US",$adapter->getCountry($usIp), "$usIp should be in the USA => US"); |
||
| 18 | } else { |
||
| 19 | $this->markTestSkipped("php geoip-module seems not to be installed."); |
||
| 20 | } |
||
| 21 | } |
||
| 22 | |||
| 38 |