Test looking up an invalid address

This commit is contained in:
Gregory Oschwald 2013-07-15 16:05:08 -07:00
parent 59a51ef34d
commit 1c0817d133

View File

@ -43,4 +43,15 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
$reader->city('10.10.10.10');
$reader->close();
}
/**
* @expectedException InvalidArgumentException
* @expectedExceptionMessage invalid is not a valid IP address
*/
public function testInvalidAddress()
{
$reader = new Reader('maxmind-db/test-data/GeoIP2-City.mmdb');
$reader->city('invalid');
$reader->close();
}
}