File tree Expand file tree Collapse file tree 3 files changed +38
-2
lines changed
Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Original file line number Diff line number Diff line change 11CHANGELOG
22=========
33
4+ 2.4.4 (2016-10-11)
5+ ------------------
6+
7+ * ` isset() ` on ` mostSpecificSubdivision ` attribute now returns the
8+ correct value. Reported by Juan Francisco Giordana. GitHub #81 .
9+
4102.4.3 (2016-10-11)
511------------------
612
7- * ` isset() ` on ` name ` attribute now returns the correct value. Fixes #79 .
13+ * ` isset() ` on ` name ` attribute now returns the correct value. Reported by
14+ Juan Francisco Giordana. GitHub #79 .
815
9162.4.2 (2016-08-17)
1017------------------
1118
1219* Updated documentation to clarify what the accuracy radius refers to.
1320* Upgraded ` maxmind/web-service-common ` to 0.3.0. This version uses
14- ` composer/ca-bundle ` rather than our own CA bundle. Fixes #75 .
21+ ` composer/ca-bundle ` rather than our own CA bundle. GitHub #75 .
1522* Improved PHP documentation generation.
1623
17242.4.1 (2016-06-10)
Original file line number Diff line number Diff line change @@ -113,6 +113,20 @@ public function __get($attr)
113113 }
114114 }
115115
116+ /**
117+ * @ignore
118+ */
119+ public function __isset ($ attr )
120+ {
121+ if ($ attr == 'mostSpecificSubdivision ' ) {
122+ // We always return a mostSpecificSubdivision, even if it is the
123+ // empty subdivision
124+ return true ;
125+ } else {
126+ return parent ::__isset ($ attr );
127+ }
128+ }
129+
116130 private function mostSpecificSubdivision ()
117131 {
118132 return empty ($ this ->subdivisions ) ?
Original file line number Diff line number Diff line change @@ -229,6 +229,11 @@ public function testEmptyObjects()
229229 '$model->mostSpecificSubdivision '
230230 );
231231
232+ $ this ->assertTrue (
233+ isset ($ model ->mostSpecificSubdivision ),
234+ 'mostSpecificSubdivision is set '
235+ );
236+
232237 $ this ->assertInstanceOf (
233238 'GeoIp2\Record\Traits ' ,
234239 $ model ->traits ,
@@ -271,4 +276,14 @@ public function testUnknown()
271276 'raw method returns raw input '
272277 );
273278 }
279+
280+ public function testMostSpecificSubdivisionWithNoSubdivisions ()
281+ {
282+ $ model = new Insights (array (), array ('en ' ));
283+
284+ $ this ->assertTrue (
285+ isset ($ model ->mostSpecificSubdivision ),
286+ 'mostSpecificSubdivision is set even on an empty response '
287+ );
288+ }
274289}
You can’t perform that action at this time.
0 commit comments