From aeba497703f72d2a06860ab090230e60c037de2f Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Mon, 20 May 2013 13:15:25 -0700 Subject: [PATCH] Added a very basic omni test as we didn't cover it previously --- tests/GeoIP2/Test/WebService/ClientTest.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/GeoIP2/Test/WebService/ClientTest.php b/tests/GeoIP2/Test/WebService/ClientTest.php index 4148c92..b85c8f4 100644 --- a/tests/GeoIP2/Test/WebService/ClientTest.php +++ b/tests/GeoIP2/Test/WebService/ClientTest.php @@ -141,6 +141,21 @@ class ClientTest extends \PHPUnit_Framework_TestCase ); } + + public function testOmni() + { + $omni = $this->client($this->getResponse('1.2.3.10')) + ->omni('1.2.3.10'); + + $this->assertInstanceOf('GeoIP2\Model\Omni', $omni); + + $this->assertEquals( + 42, + $omni->continent->geonameId, + 'continent geoname_id is 42' + ); + } + public function testMe() { $client = $this->client($this->getResponse('me')); @@ -280,7 +295,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase $all_requests = $plugin->getReceivedRequests(); $request = $all_requests[0]; - + $this->assertEquals( 'https://geoip.maxmind.com/geoip/v2.0/country/1.2.3.4', $request->getUrl(),