diff --git a/src/GeoIP2/Record/Continent.php b/src/GeoIP2/Record/Continent.php index d0bbc48..0ee1a20 100644 --- a/src/GeoIP2/Record/Continent.php +++ b/src/GeoIP2/Record/Continent.php @@ -7,9 +7,8 @@ namespace GeoIP2\Record; * * This record is returned by all the end points. * - * @property string $continentCode A two character continent code - * like "NA" (North America) or "OC" (Oceania). This attribute is returned - * by all end points. + * @property string $code A two character continent code like "NA" (North + * America) or "OC" (Oceania). This attribute is returned by all end points. * * @property int $geonameId The GeoName ID for the continent. This attribute * is returned by all end points. @@ -27,7 +26,7 @@ class Continent extends AbstractPlaceRecord * @ignore */ protected $validAttributes = array( - 'continentCode', + 'code', 'geonameId', 'names' ); diff --git a/tests/GeoIP2/Test/Model/CountryTest.php b/tests/GeoIP2/Test/Model/CountryTest.php index b17e50a..f456aa4 100644 --- a/tests/GeoIP2/Test/Model/CountryTest.php +++ b/tests/GeoIP2/Test/Model/CountryTest.php @@ -9,9 +9,9 @@ class CountryTest extends \PHPUnit_Framework_TestCase private $raw = array( 'continent' => array( - 'continent_code' => 'NA', - 'geoname_id' => 42, - 'names' => array( 'en' => 'North America' ), + 'code' => 'NA', + 'geoname_id' => 42, + 'names' => array( 'en' => 'North America' ), ), 'country' => array( 'geoname_id' => 1, @@ -75,8 +75,8 @@ class CountryTest extends \PHPUnit_Framework_TestCase $this->assertEquals( 'NA', - $this->model->continent->continentCode, - 'continent continent_code is NA' + $this->model->continent->code, + 'continent code is NA' ); $this->assertEquals( diff --git a/tests/GeoIP2/Test/Model/NameTest.php b/tests/GeoIP2/Test/Model/NameTest.php index 2cf22ca..c34686d 100644 --- a/tests/GeoIP2/Test/Model/NameTest.php +++ b/tests/GeoIP2/Test/Model/NameTest.php @@ -8,9 +8,9 @@ class NameTest extends \PHPUnit_Framework_TestCase { public $raw = array( 'continent' => array( - 'continent_code' => 'NA', - 'geoname_id' => 42, - 'names' => array( + 'code' => 'NA', + 'geoname_id' => 42, + 'names' => array( 'en' => 'North America', 'zh-CN' => '北美洲', ), diff --git a/tests/GeoIP2/Test/Model/OmniTest.php b/tests/GeoIP2/Test/Model/OmniTest.php index 90e1db1..18d3736 100644 --- a/tests/GeoIP2/Test/Model/OmniTest.php +++ b/tests/GeoIP2/Test/Model/OmniTest.php @@ -17,9 +17,9 @@ class OmniTest extends \PHPUnit_Framework_TestCase 'names' => array( 'en' => 'Minneapolis' ), ), 'continent' => array( - 'continent_code' => 'NA', - 'geoname_id' => 42, - 'names' => array( 'en' => 'North America' ), + 'code' => 'NA', + 'geoname_id' => 42, + 'names' => array( 'en' => 'North America' ), ), 'country' => array( 'confidence' => 99, @@ -181,7 +181,7 @@ class OmniTest extends \PHPUnit_Framework_TestCase $model->representedCountry, '$model->representedCountry' ); - + $this->assertCount( 0, $model->subdivisions, diff --git a/tests/GeoIP2/Test/WebService/ClientTest.php b/tests/GeoIP2/Test/WebService/ClientTest.php index 28926e3..0565604 100644 --- a/tests/GeoIP2/Test/WebService/ClientTest.php +++ b/tests/GeoIP2/Test/WebService/ClientTest.php @@ -13,9 +13,9 @@ class ClientTest extends \PHPUnit_Framework_TestCase private $country = array( 'continent' => array( - 'continent_code' => 'NA', - 'geoname_id' => 42, - 'names' => array( 'en' => 'North America' ), + 'code' => 'NA', + 'geoname_id' => 42, + 'names' => array( 'en' => 'North America' ), ), 'country' => array( 'geoname_id' => 1, @@ -100,8 +100,8 @@ class ClientTest extends \PHPUnit_Framework_TestCase $this->assertEquals( 'NA', - $country->continent->continentCode, - 'continent continent_code is NA' + $country->continent->code, + 'continent code is NA' ); $this->assertEquals(