|
@@ 75-82 (lines=8) @@
|
| 72 |
|
/** |
| 73 |
|
* Fail test case for getGeoLocation |
| 74 |
|
*/ |
| 75 |
|
public function testGetGeoLocationFail() |
| 76 |
|
{ |
| 77 |
|
$_SERVER['REMOTE_ADDR'] = ''; |
| 78 |
|
$location = $this->getMock($this->responseFail)->getGeoLocation(); |
| 79 |
|
|
| 80 |
|
$this->assertFalse($location->getStatus()); |
| 81 |
|
$this->assertSame('reserved range', $location->getMessage()); |
| 82 |
|
} |
| 83 |
|
|
| 84 |
|
/** |
| 85 |
|
* Test case for invalid Ip Address |
|
@@ 112-118 (lines=7) @@
|
| 109 |
|
/** |
| 110 |
|
* Test case for invalid response |
| 111 |
|
*/ |
| 112 |
|
public function testResponseInvalid() |
| 113 |
|
{ |
| 114 |
|
$location = $this->getMock(array(), 500)->getGeoLocation(); |
| 115 |
|
|
| 116 |
|
$this->assertFalse($location->getStatus()); |
| 117 |
|
$this->assertSame('Request failed with response code: 500 and response: Internal Server Error', $location->getMessage()); |
| 118 |
|
} |
| 119 |
|
|
| 120 |
|
/** |
| 121 |
|
* Get mocked object to avoid live api requests |