Permalink
Browse files

* ability to set an array of failover servers,

* better doc strings and various cosmetic changes.


git-svn-id: http://svn.php.net/repository/pear/packages/Services_GeoNames/trunk@274374 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent aa1010e commit 73acbc5d0aa6bc7d9535aece8b257a9711ef7d41 @izimobil izimobil committed Jan 23, 2009
View
89 Services/GeoNames.php
@@ -13,10 +13,10 @@
*
* @category Services
* @package Services_GeoNames
- * @author David JEAN LOUIS <izimobil@gmail.com>
- * @copyright 2008 David JEAN LOUIS
+ * @author David Jean Louis <izi@php.net>
+ * @copyright 2008-2009 David Jean Louis
* @license http://opensource.org/licenses/mit-license.php MIT License
- * @version SVN: $Id$
+ * @version CVS: $Id$
* @link http://pear.php.net/package/Services_GeoNames
* @link http://www.geonames.org/export/web-services.html
* @since File available since release 0.1.0
@@ -35,8 +35,8 @@
*
* @category Services
* @package Services_GeoNames
- * @author David JEAN LOUIS <izimobil@gmail.com>
- * @copyright 2008 David JEAN LOUIS
+ * @author David Jean Louis <izi@php.net>
+ * @copyright 2008-2009 David Jean Louis
* @license http://opensource.org/licenses/mit-license.php MIT License
* @version Release: @package_version@
* @link http://pear.php.net/package/Services_GeoNames
@@ -106,11 +106,18 @@ class Services_GeoNames
/**
* Url of the GeoNames web service.
- * This should not change but anyway we make it public.
*
* @var string $url
*/
- public static $url = 'http://ws.geonames.org';
+ public $url = 'http://ws.geonames.org';
+
+ /**
+ * Array of failover servers.
+ *
+ * @var array $failoverServers
+ * @see Services_GeoNames::sendRequest()
+ */
+ public $failoverServers = array();
/**
* The HTTP_Request2 instance, you can customize the request if you want to
@@ -230,7 +237,7 @@ public function __construct($username = null, $token = null)
public function __call($endpoint, $params = array())
{
// check that endpoint is supported
- if (!in_array($endpoint, array_keys($this->endpoints))) {
+ if (!in_array($endpoint, $this->getSupportedEndpoints())) {
throw new Services_GeoNames_Exception(
'Unknown service endpoint "' . $endpoint . '"',
self::UNSUPPORTED_ENDPOINT
@@ -249,6 +256,8 @@ public function __call($endpoint, $params = array())
// we only do json
unset($params['type']);
}
+
+ // manage authentication to commercial webservice
if ($this->username !== null) {
$params['username'] = $this->username;
}
@@ -258,8 +267,8 @@ public function __call($endpoint, $params = array())
// build the url and retrieve the result
$qString = $this->formatQueryString($params);
- $url = self::$url . '/' . $endpoint . 'JSON?' . $qString;
- $ret = json_decode($this->sendRequest($url));
+ $urlPath = '/' . $endpoint . 'JSON?' . $qString;
+ $ret = json_decode($this->sendRequest($urlPath));
// check if we have a error response
if (isset($ret->status->message) && isset($ret->status->value)) {
@@ -270,7 +279,7 @@ public function __call($endpoint, $params = array())
}
// remove useless root property, to make the result more user friendly
- if ($this->endpoints[$endpoint] !== false) {
+ if ($this->endpoints[$endpoint] !== false && $ret instanceof stdclass) {
$prop = $this->endpoints[$endpoint];
$ret = $ret->$prop;
}
@@ -283,33 +292,57 @@ public function __call($endpoint, $params = array())
/**
* Sends the request to the server using HTTP_Request2.
*
- * @param string $url The full service url (url + endpoint + query string)
+ * @param string $urlPath The url path *without* the scheme://host
*
* @return string The response body
* @throws HTTP_Request2_Exception
* @throws Services_GeoNames_HTTPException When something goes wrong when
* building the request or
* requesting the server.
*/
- protected function sendRequest($url)
+ protected function sendRequest($urlPath)
{
- try {
- $request = clone $this->getRequest();
- $request->setUrl($url);
- $response = $request->send();
- } catch (HTTP_Request2_Exception $exc) {
- throw new Services_GeoNames_HTTPException(
- $exc->getMessage(),
- $exc // the original exception cause
- );
+ $exceptionStack = array();
+ $response = null;
+ array_unshift($this->failoverServers, $this->url);
+
+ foreach ($this->failoverServers as $server) {
+ try {
+ $request = clone $this->getRequest();
+ $request->setUrl(rtrim($server, '/') . $urlPath);
+ $response = $request->send();
+ } catch (Exception $exc) {
+ $exceptionStack[] = new Services_GeoNames_HTTPException(
+ $exc->getMessage(),
+ $exc
+ );
+ continue;
+ }
+ if ($response->getStatus() != 200) {
+ $exceptionStack[] = new Services_GeoNames_HTTPException(
+ $response->getReasonPhrase(),
+ $response->getStatus(),
+ $response
+ );
+ // reset the response variable since it's not a valid one
+ $response = null;
+ } else {
+ break;
+ }
}
- if ($response->getStatus() != 200) {
- throw new Services_GeoNames_HTTPException(
- $response->getReasonPhrase(),
- $response->getStatus(),
- $response
- );
+
+ if ($response == null && !empty($exceptionStack)) {
+ $lastException = $exceptionStack[count($exceptionStack)-1];
+ if (count($exceptionStack) == 1) {
+ throw $lastException;
+ } else {
+ throw new Services_GeoNames_HTTPException(
+ $lastException->getMessage(),
+ $exceptionStack
+ );
+ }
}
+
return $response->getBody();
}
View
14 Services/GeoNames/Exception.php
@@ -13,10 +13,10 @@
*
* @category Services
* @package Services_GeoNames
- * @author David JEAN LOUIS <izimobil@gmail.com>
- * @copyright 2008 David JEAN LOUIS
+ * @author David Jean Louis <izi@php.net>
+ * @copyright 2008-2009 David Jean Louis
* @license http://opensource.org/licenses/mit-license.php MIT License
- * @version SVN: $Id$
+ * @version CVS: $Id$
* @link http://pear.php.net/package/Services_GeoNames
* @link http://www.geonames.org/export/webservice-exception.html
* @since File available since release 0.1.0
@@ -33,8 +33,8 @@
*
* @category Services
* @package Services_GeoNames
- * @author David JEAN LOUIS <izimobil@gmail.com>
- * @copyright 2008 David JEAN LOUIS
+ * @author David Jean Louis <izi@php.net>
+ * @copyright 2008-2009 David Jean Louis
* @license http://opensource.org/licenses/mit-license.php MIT License
* @version Release: @package_version@
* @link http://pear.php.net/package/Services_GeoNames
@@ -64,8 +64,8 @@ class Services_GeoNames_Exception extends PEAR_Exception
*
* @category Services
* @package Services_GeoNames
- * @author David JEAN LOUIS <izimobil@gmail.com>
- * @copyright 2008 David JEAN LOUIS
+ * @author David Jean Louis <izi@php.net>
+ * @copyright 2008-2009 David Jean Louis
* @license http://opensource.org/licenses/mit-license.php MIT License
* @version Release: @package_version@
* @link http://pear.php.net/package/Services_GeoNames
View
6 examples/examples1.php
@@ -12,10 +12,10 @@
*
* @category Services
* @package Services_GeoNames
- * @author David JEAN LOUIS <izimobil@gmail.com>
- * @copyright 2008 David JEAN LOUIS
+ * @author David Jean Louis <izi@php.net>
+ * @copyright 2008-2009 David Jean Louis
* @license http://opensource.org/licenses/mit-license.php MIT License
- * @version SVN: $Id$
+ * @version CVS: $Id$
* @link http://pear.php.net/package/Services_GeoNames
* @link http://www.geonames.org/export/webservice-exception.html
* @since File available since release 0.1.0
View
59 package.xml
@@ -42,20 +42,46 @@ For more information please visit:
<email>izimobil@gmail.com</email>
<active>yes</active>
</lead>
- <date>2008-12-19</date>
+ <date>2009-01-23</date>
<version>
- <release>0.2.2</release>
- <api>0.2.2</api>
+ <release>0.2.3</release>
+ <api>0.2.3</api>
</version>
<stability>
<release>beta</release>
<api>beta</api>
</stability>
<license uri="http://www.opensource.org/licenses/mit-license.html">MIT</license>
<notes>
-* added getter/setter for request (now protected),
-* better exceptions management,
-* better tests layout/coverage.
+<![CDATA[
+* clone the HTTP_Request2 instance instead of the reusing the same instance,
+* ability to set an array of failover servers,
+* better doc strings and various cosmetic changes.
+
+Important note
+==============
+From http://www.geonames.org/export/ :
+"We have temporarily removed the domain ws.geonames.org from the dns setting to
+protect the server from exessive use by an iphone application. You can access
+the server with the domain ws5.geonames.org"
+
+So until ws.geonames.org is not restored, you'll have to do either:
+<?php
+require_once 'Services/GeoNames.php';
+
+$geo = new Services_GeoNames();
+$geo->url = 'http://ws5.geonames.org';
+?>
+
+or:
+
+<?php
+require_once 'Services/GeoNames.php';
+
+$geo = new Services_GeoNames();
+$geo->failoverServers[] = 'http://ws5.geonames.org';
+?>
+]]>
</notes>
<contents>
<dir name="/">
@@ -92,6 +118,8 @@ For more information please visit:
<file name="tests/test_other_03.phpt" role="test" />
<file name="tests/test_other_04.phpt" role="test" />
<file name="tests/test_other_05.phpt" role="test" />
+ <file name="tests/test_other_06.phpt" role="test" />
+ <file name="tests/test_other_07.phpt" role="test" />
<file name="tests/test_postalcodecountryinfo.phpt" role="test" />
<file name="tests/test_postalcodelookup.phpt" role="test" />
<file name="tests/test_postalcodesearch.phpt" role="test" />
@@ -123,6 +151,7 @@ For more information please visit:
<file name="tests/data/test_neighbourhood.dat" role="test" />
<file name="tests/data/test_neighbours.dat" role="test" />
<file name="tests/data/test_other_03.dat" role="test" />
+ <file name="tests/data/test_other_06.dat" role="test" />
<file name="tests/data/test_postalcodecountryinfo.dat" role="test" />
<file name="tests/data/test_postalcodelookup.dat" role="test" />
<file name="tests/data/test_postalcodesearch.dat" role="test" />
@@ -206,5 +235,23 @@ For more information please visit:
</notes>
</release>
+ <!-- version 0.2.2 -->
+ <release>
+ <version>
+ <release>0.2.2</release>
+ <api>0.2.2</api>
+ </version>
+ <stability>
+ <release>beta</release>
+ <api>beta</api>
+ </stability>
+ <license uri="http://www.opensource.org/licenses/mit-license.html">MIT</license>
+ <notes>
+* added getter/setter for request (now protected),
+* better exceptions management,
+* better tests layout/coverage.
+ </notes>
+ </release>
+
</changelog>
</package>
View
10 tests/AllTests.php
@@ -13,10 +13,10 @@
*
* @category Services
* @package Services_GeoNames
- * @author David JEAN LOUIS <izimobil@gmail.com>
- * @copyright 2007 David JEAN LOUIS
+ * @author David Jean Louis <izi@php.net>
+ * @copyright 2008-2009 David Jean Louis
* @license http://opensource.org/licenses/mit-license.php MIT License
- * @version SVN: $Id$
+ * @version CVS: $Id$
* @link http://pear.php.net/package/Services_GeoNames
* @since File available since release 0.1.0
*/
@@ -39,8 +39,8 @@
*
* @category Services
* @package Services_GeoNames
- * @author David JEAN LOUIS <izimobil@gmail.com>
- * @copyright 2007 David JEAN LOUIS
+ * @author David Jean Louis <izi@php.net>
+ * @copyright 2008-2009 David Jean Louis
* @license http://opensource.org/licenses/mit-license.php MIT License
* @version Release: @package_version@
* @link http://pear.php.net/package/Services_GeoNames
View
6 tests/data/test_get.dat
@@ -92,7 +92,7 @@
"countryName": "",
"adminCode1": "20",
"fclName": "parks,area, ...",
- "lng": 9.00266826152802,
+ "lng": 0,
"adminName2": "",
"adminName3": "",
"fcodeName": "",
@@ -106,7 +106,7 @@
"name": "Globe",
"fcode": "",
"geonameId": 6295630,
- "lat": 46.01308817645,
+ "lat": 0,
"population": 0,
"adminName1": "null.20"
-}
+}
View
8 tests/data/test_hierarchy.dat
@@ -50,7 +50,7 @@
"lang": "de"
},
{
- "name": "Mundo",
+ "name": "el planeta",
"lang": "es"
},
{
@@ -60,7 +60,7 @@
],
"countryName": "",
"fclName": "parks,area, ...",
- "lng": 9.00266826152802,
+ "lng": 0,
"adminName2": "",
"adminName3": "",
"fcodeName": "",
@@ -74,7 +74,7 @@
"name": "Globe",
"fcode": "",
"geonameId": 6295630,
- "lat": 46.01308817645,
+ "lat": 0,
"population": 0,
"adminName1": ""
},
@@ -818,4 +818,4 @@
"population": 341730,
"adminName1": "Zürich"
}
-]}
+]}
View
1 tests/data/test_other_06.dat
@@ -0,0 +1 @@
+{"totalResultsCount":1806,"geonames":[{"countryName":"France","adminCode1":"A8","fclName":"city, village,...","countryCode":"FR","lng":2.3488,"fcodeName":"capital of a political entity","fcl":"P","name":"Paris","fcode":"PPLC","geonameId":2988507,"lat":48.85341,"population":2138551,"adminName1":"Île-de-France"},{"fcodeName":"mountain","countryName":"Antarctica","fcl":"T","fclName":"mountain,hill,rock,... ","name":"Paris, Mount","countryCode":"AQ","lng":-70.8333333,"fcode":"MT","geonameId":6622909,"lat":-68.9833333,"adminName1":"","population":0},{"countryName":"France","adminCode1":"A8","fclName":"country, state, region,...","countryCode":"FR","lng":2.34859853982925,"fcodeName":"second-order administrative division","fcl":"A","name":"Département de Ville-de-Paris","fcode":"ADM2","geonameId":2968815,"lat":48.8534032808282,"population":2138551,"adminName1":"Île-de-France"},{"countryName":"United States","adminCode1":"TX","fclName":"city, village,...","countryCode":"US","lng":-95.555513,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":4717560,"lat":33.6609389,"population":27022,"adminName1":"Texas"},{"countryName":"Iran","adminCode1":"09","fclName":"city, village,...","countryCode":"IR","lng":49.4025,"fcodeName":"populated place","fcl":"P","name":"Parīs Banīch","fcode":"PPL","geonameId":121379,"lat":35.4691667,"population":0,"adminName1":"Hamadān"},{"countryName":"France","adminCode1":"B4","fclName":"city, village,...","countryCode":"FR","lng":1.5833333,"fcodeName":"populated place","fcl":"P","name":"Le Touquet-Paris-Plage","fcode":"PPL","geonameId":2999139,"lat":50.5166667,"population":5696,"adminName1":"Nord-Pas-de-Calais"},{"countryName":"France","adminCode1":"A8","fclName":"city, village,...","countryCode":"FR","lng":2.2769,"fcodeName":"section of populated place","fcl":"P","name":"XVIe arrondissement","fcode":"PPLX","geonameId":2988394,"lat":48.8637,"population":0,"adminName1":"Île-de-France"},{"countryName":"France","adminCode1":"A8","fclName":"spot, building, farm","countryCode":"FR","lng":2.3500657081604,"fcodeName":"church","fcl":"S","name":"Notre Dame","fcode":"CH","geonameId":6269274,"lat":48.8529550041241,"population":0,"adminName1":"Île-de-France"},{"countryName":"France","adminCode1":"A8","fclName":"spot, building, farm","countryCode":"FR","lng":2.359444,"fcodeName":"airport","fcl":"S","name":"Paris-Orly","fcode":"AIRP","geonameId":2988500,"lat":48.725278,"population":0,"adminName1":"Île-de-France"},{"countryName":"France","adminCode1":"A8","fclName":"city, village,...","countryCode":"FR","lng":2.33,"fcodeName":"section of populated place","fcl":"P","name":"Saint-Sulpice","fcode":"PPLX","geonameId":2997000,"lat":48.8493,"population":0,"adminName1":"Île-de-France"},{"countryName":"France","adminCode1":"A8","fclName":"city, village,...","countryCode":"FR","lng":2.321,"fcodeName":"section of populated place","fcl":"P","name":"Paris 07 Palais-Bourbon","fcode":"PPLX","geonameId":2988760,"lat":48.8565,"population":0,"adminName1":"Île-de-France"},{"countryName":"France","adminCode1":"A8","fclName":"city, village,...","countryCode":"FR","lng":2.3003,"fcodeName":"section of populated place","fcl":"P","name":"Paris 15 Vaugirard","fcode":"PPLX","geonameId":2970479,"lat":48.8412,"population":0,"adminName1":"Île-de-France"},{"countryName":"France","adminCode1":"A8","fclName":"city, village,...","countryCode":"FR","lng":2.3615,"fcodeName":"section of populated place","fcl":"P","name":"Paris 03 Temple","fcode":"PPLX","geonameId":2973189,"lat":48.8637,"population":0,"adminName1":"Île-de-France"},{"countryName":"France","adminCode1":"A8","fclName":"city, village,...","countryCode":"FR","lng":2.3795,"fcodeName":"section of populated place","fcl":"P","name":"Paris 11 Popincourt","fcode":"PPLX","geonameId":2986082,"lat":48.8574,"population":0,"adminName1":"Île-de-France"},{"countryName":"France","adminCode1":"A8","fclName":"city, village,...","countryCode":"FR","lng":2.3876,"fcodeName":"section of populated place","fcl":"P","name":"Paris 12 Reuilly","fcode":"PPLX","geonameId":2983854,"lat":48.8412,"population":0,"adminName1":"Île-de-France"},{"countryName":"France","adminCode1":"A8","fclName":"city, village,...","countryCode":"FR","lng":2.3471,"fcodeName":"section of populated place","fcl":"P","name":"Paris 05 Panthéon","fcode":"PPLX","geonameId":2988623,"lat":48.8448,"population":0,"adminName1":"Île-de-France"},{"countryName":"France","adminCode1":"A8","fclName":"city, village,...","countryCode":"FR","lng":2.3399,"fcodeName":"section of populated place","fcl":"P","name":"Paris 09 Opéra","fcode":"PPLX","geonameId":2989487,"lat":48.8718,"population":0,"adminName1":"Île-de-France"},{"countryName":"France","adminCode1":"A8","fclName":"city, village,...","countryCode":"FR","lng":2.3264,"fcodeName":"section of populated place","fcl":"P","name":"Paris 14 Observatoire","fcode":"PPLX","geonameId":2989781,"lat":48.8331,"population":0,"adminName1":"Île-de-France"},{"countryName":"France","adminCode1":"A8","fclName":"city, village,...","countryCode":"FR","lng":2.3984,"fcodeName":"section of populated place","fcl":"P","name":"Paris 20 Ménilmontant","fcode":"PPLX","geonameId":2994540,"lat":48.8646,"population":0,"adminName1":"Île-de-France"},{"countryName":"France","adminCode1":"A8","fclName":"city, village,...","countryCode":"FR","lng":2.3561,"fcodeName":"section of populated place","fcl":"P","name":"Paris 13 Gobelins","fcode":"PPLX","geonameId":3015772,"lat":48.8322,"population":0,"adminName1":"Île-de-France"},{"countryName":"France","adminCode1":"A8","fclName":"city, village,...","countryCode":"FR","lng":2.3561,"fcodeName":"section of populated place","fcl":"P","name":"Paris 10 Entrepôt","fcode":"PPLX","geonameId":3020216,"lat":48.8709,"population":0,"adminName1":"Île-de-France"},{"countryName":"France","adminCode1":"A8","fclName":"city, village,...","countryCode":"FR","lng":2.3219,"fcodeName":"section of populated place","fcl":"P","name":"Paris 17 Batignolles-Monceau","fcode":"PPLX","geonameId":3034610,"lat":48.8835,"population":0,"adminName1":"Île-de-France"},{"countryName":"France","adminCode1":"A8","fclName":"city, village,...","countryCode":"FR","lng":2.3183,"fcodeName":"section of populated place","fcl":"P","name":"Paris 08 Élysée","fcode":"PPLX","geonameId":3020270,"lat":48.8763,"population":0,"adminName1":"Île-de-France"},{"countryName":"France","adminCode1":"A8","fclName":"city, village,...","countryCode":"FR","lng":2.3822,"fcodeName":"section of populated place","fcl":"P","name":"Paris 19 Buttes-Chaumont","fcode":"PPLX","geonameId":3029372,"lat":48.8817,"population":0,"adminName1":"Île-de-France"},{"countryName":"France","adminCode1":"A8","fclName":"city, village,...","countryCode":"FR","lng":2.3426,"fcodeName":"section of populated place","fcl":"P","name":"Paris 02 Bourse","fcode":"PPLX","geonameId":3030864,"lat":48.8655,"population":0,"adminName1":"Île-de-France"},{"countryName":"France","adminCode1":"A8","fclName":"city, village,...","countryCode":"FR","lng":2.3444,"fcodeName":"section of populated place","fcl":"P","name":"Paris 18 Buttes-Montmartre","fcode":"PPLX","geonameId":3029374,"lat":48.8925,"population":0,"adminName1":"Île-de-France"},{"countryName":"France","adminCode1":"A8","fclName":"spot, building, farm","countryCode":"FR","lng":2.34613090753555,"fcodeName":"tomb(s)","fcl":"S","name":"Panthéon","fcode":"TMB","geonameId":6269532,"lat":48.8462409625787,"population":0,"adminName1":"Île-de-France"},{"countryName":"France","adminCode1":"A8","fclName":"city, village,...","countryCode":"FR","lng":2.3417,"fcodeName":"section of populated place","fcl":"P","name":"Paris 01 Louvre","fcode":"PPLX","geonameId":6269531,"lat":48.8592,"population":0,"adminName1":"Île-de-France"},{"countryName":"United States","adminCode1":"AR","fclName":"city, village,...","countryCode":"US","lng":-93.7299173,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":4125402,"lat":35.2920325,"population":3689,"adminName1":"Arkansas"},{"countryName":"United States","adminCode1":"IL","fclName":"city, village,...","countryCode":"US","lng":-87.6961374,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":4246659,"lat":39.611146,"population":8875,"adminName1":"Illinois"},{"countryName":"United States","adminCode1":"KY","fclName":"city, village,...","countryCode":"US","lng":-84.2529869,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":4303602,"lat":38.2097987,"population":9332,"adminName1":"Kentucky"},{"countryName":"United States","adminCode1":"MO","fclName":"city, village,...","countryCode":"US","lng":-92.0012811,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":4402452,"lat":39.4808721,"population":1472,"adminName1":"Missouri"},{"countryName":"United States","adminCode1":"TN","fclName":"city, village,...","countryCode":"US","lng":-88.3267107,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":4647963,"lat":36.3020023,"population":9587,"adminName1":"Tennessee"},{"countryName":"United States","adminCode1":"ME","fclName":"city, village,...","countryCode":"US","lng":-70.5006152,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":4974617,"lat":44.2597917,"population":5073,"adminName1":"Maine"},{"countryName":"Suriname","adminCode1":"18","fclName":"stream, lake, ...","countryCode":"SR","lng":-56.9666667,"fcodeName":"stream","fcl":"H","name":"Paris Jacob Kreek","fcode":"STM","geonameId":3383324,"lat":4.9,"population":0,"adminName1":"Sipaliwini"},{"countryName":"Iran","adminCode1":"26","fclName":"mountain,hill,rock,... ","countryCode":"IR","lng":51.35,"fcodeName":"pass","fcl":"T","name":"Gardaneh-ye Pārīs","fcode":"PASS","geonameId":121418,"lat":35.9,"population":0,"adminName1":"Tehrān"},{"countryName":"Panama","adminCode1":"06","fclName":"country, state, region,...","countryCode":"PA","lng":-80.55,"fcodeName":"third-order administrative division","fcl":"A","name":"Corregimiento París","fcode":"ADM3","geonameId":3703357,"lat":8.0666667,"population":0,"adminName1":"Herrera"},{"countryName":"Kiribati","adminCode1":"00","fclName":"parks,area, ...","countryCode":"KI","lng":-157.5,"fcodeName":"locality","fcl":"L","name":"Paris","fcode":"LCTY","geonameId":4030913,"lat":1.9333333,"population":0,"adminName1":""},{"countryName":"United States","adminCode1":"OH","fclName":"city, village,...","countryCode":"US","lng":-84.7932918,"fcodeName":"populated place","fcl":"P","name":"New Paris","fcode":"PPL","geonameId":4519642,"lat":39.8569934,"population":1520,"adminName1":"Ohio"},{"countryName":"United States","adminCode1":"ME","fclName":"city, village,...","countryCode":"US","lng":-70.5133929,"fcodeName":"populated place","fcl":"P","name":"South Paris","fcode":"PPL","geonameId":4979220,"lat":44.223681,"population":2250,"adminName1":"Maine"},{"countryName":"United States","adminCode1":"ME","fclName":"city, village,...","countryCode":"US","lng":-70.5739515,"fcodeName":"populated place","fcl":"P","name":"West Paris","fcode":"PPL","geonameId":4982671,"lat":44.3242347,"population":1790,"adminName1":"Maine"},{"countryName":"United States","adminCode1":"OH","fclName":"city, village,...","countryCode":"US","lng":-83.959658,"fcodeName":"populated place","fcl":"P","name":"Saint Paris","fcode":"PPL","geonameId":5170013,"lat":40.128389,"population":1975,"adminName1":"Ohio"},{"countryName":"United States","adminCode1":"CO","fclName":"mountain,hill,rock,... ","countryCode":"US","lng":-105.368055,"fcodeName":"mountain","fcl":"T","name":"Paris Hill","fcode":"MT","geonameId":5433942,"lat":38.1119455,"population":0,"adminName1":"Colorado"},{"countryName":"United States","adminCode1":"ID","fclName":"mountain,hill,rock,... ","countryCode":"US","lng":-111.5493802,"fcodeName":"mountain","fcl":"T","name":"Paris Peak","fcode":"MT","geonameId":5603246,"lat":42.2029814,"population":0,"adminName1":"Idaho"},{"countryName":"New Zealand","adminCode1":"E9","fclName":"mountain,hill,rock,... ","countryCode":"NZ","lng":170.690092375,"fcodeName":"hill","fcl":"T","name":"Paris","fcode":"HLL","geonameId":6211205,"lat":-43.608321173,"population":0,"adminName1":"Canterbury"},{"countryName":"United States","adminCode1":"ID","fclName":"mountain,hill,rock,... ","countryCode":"US","lng":-111.5841045,"fcodeName":"plain(s)","fcl":"T","name":"Paris Flat","fcode":"PLN","geonameId":5603252,"lat":42.2199251,"population":0,"adminName1":"Idaho"},{"fcodeName":"peak","countryName":"Antarctica","fcl":"T","fclName":"mountain,hill,rock,... ","name":"Paris Peak","countryCode":"AQ","lng":-63.3666667,"fcode":"PK","geonameId":6622908,"lat":-64.5,"adminName1":"","population":0},{"countryName":"France","adminCode1":"A8","fclName":"spot, building, farm","countryCode":"FR","lng":2.3250675201416,"fcodeName":"railroad station","fcl":"S","name":"Gare Saint-Lazare","fcode":"RSTN","geonameId":2978860,"lat":48.8767963404673,"population":0,"adminName1":"Île-de-France"},{"countryName":"France","adminCode1":"A8","fclName":"country, state, region,...","countryCode":"FR","lng":2.34864413738251,"fcodeName":"third-order administrative division","fcl":"A","name":"Arrondissement de Paris","fcode":"ADM3","geonameId":2988506,"lat":48.853385632215,"population":0,"adminName1":"Île-de-France"},{"countryName":"Nicaragua","adminCode1":"00","fclName":"stream, lake, ...","countryCode":"NI","lng":-85.1166667,"fcodeName":"stream","fcl":"H","name":"Río París","fcode":"STM","geonameId":3617327,"lat":11.0833333,"population":0,"adminName1":""},{"countryName":"France","adminCode1":"A8","fclName":"country, state, region,...","countryCode":"FR","lng":2.35236167907715,"fcodeName":"fourth-order administrative division","fcl":"A","name":"Paris","fcode":"ADM4","geonameId":6455259,"lat":48.8564563972794,"population":0,"adminName1":"Île-de-France"},{"countryName":"France","adminCode1":"A8","fclName":"spot, building, farm","countryCode":"FR","lng":2.55,"fcodeName":"airport","fcl":"S","name":"Paris - Charles-de-Gaulle","fcode":"AIRP","geonameId":6269554,"lat":49.012779,"population":0,"adminName1":"Île-de-France"},{"countryName":"French Southern Territories","adminCode1":"00","fclName":"mountain,hill,rock,... ","countryCode":"TF","lng":69.1333333,"fcodeName":"mountain","fcl":"T","name":"Mont Pâris","fcode":"MT","geonameId":1546159,"lat":-49.1833333,"population":0,"adminName1":""},{"countryName":"Philippines","adminCode1":"06","fclName":"city, village,...","countryCode":"PH","lng":122.0666667,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":1694661,"lat":11.3,"population":0,"adminName1":"Antique"},{"countryName":"Malaysia","adminCode1":"11","fclName":"stream, lake, ...","countryCode":"MY","lng":111.6666667,"fcodeName":"stream","fcl":"H","name":"Sungai Paris","fcode":"STM","geonameId":1752110,"lat":1.3333333,"population":0,"adminName1":"Sarawak"},{"countryName":"Russia","adminCode1":"59","fclName":"stream, lake, ...","countryCode":"RU","lng":131.9175,"fcodeName":"bay","fcl":"H","name":"Bukhta Paris","fcode":"BAY","geonameId":2018127,"lat":43.0125,"population":0,"adminName1":"Primorskiy Kray"},{"countryName":"Australia","adminCode1":"05","fclName":"stream, lake, ...","countryCode":"AU","lng":138.8333333,"fcodeName":"stream","fcl":"H","name":"Paris Creek","fcode":"STM","geonameId":2063826,"lat":-35.25,"population":0,"adminName1":"South Australia"},{"countryName":"New Zealand","adminCode1":"00","fclName":"mountain,hill,rock,... ","countryCode":"NZ","lng":169.0166667,"fcodeName":"mountain","fcl":"T","name":"Mount Paris","fcode":"MT","geonameId":2184867,"lat":-52.5666667,"population":0,"adminName1":""},{"countryName":"Congo - Brazzaville","adminCode1":"11","fclName":"city, village,...","countryCode":"CG","lng":14.6905556,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":2255462,"lat":-4.7452778,"population":0,"adminName1":"Pool"},{"countryName":"Congo - Brazzaville","adminCode1":"11","fclName":"city, village,...","countryCode":"CG","lng":14.1688889,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":2255463,"lat":-4.2633333,"population":0,"adminName1":"Pool"},{"countryName":"Togo","adminCode1":"00","fclName":"city, village,...","countryCode":"TG","lng":1.0833333,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":2364431,"lat":7.15,"population":0,"adminName1":""},{"countryName":"Gabon","adminCode1":"07","fclName":"city, village,...","countryCode":"GA","lng":12.45,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":2396598,"lat":-1.2833333,"population":0,"adminName1":"Ogooué-Lolo"},{"countryName":"Gabon","adminCode1":"03","fclName":"city, village,...","countryCode":"GA","lng":10.3,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":2396599,"lat":-0.6666667,"population":0,"adminName1":"Moyen-Ogooué"},{"countryName":"Gabon","adminCode1":"03","fclName":"city, village,...","countryCode":"GA","lng":10,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":2396600,"lat":-0.5666667,"population":0,"adminName1":"Moyen-Ogooué"},{"countryName":"Sao Tome and Principe","adminCode1":"02","fclName":"city, village,...","countryCode":"ST","lng":6.6833333,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":2410936,"lat":0.3333333,"population":0,"adminName1":"São Tomé"},{"countryName":"Malta","adminCode1":"00","fclName":"parks,area, ...","countryCode":"MT","lng":14.3633333,"fcodeName":"locality","fcl":"L","name":"Ta' Paris","fcode":"LCTY","geonameId":2564580,"lat":35.8908333,"population":0,"adminName1":""},{"countryName":"Congo - Brazzaville","adminCode1":"10","fclName":"city, village,...","countryCode":"CG","lng":15.6405556,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":2565615,"lat":1.5527778,"population":0,"adminName1":"Sangha"},{"countryName":"French Guiana","adminCode1":"00","fclName":"stream, lake, ...","countryCode":"GF","lng":-53.8166667,"fcodeName":"stream","fcl":"H","name":"Crique Paris","fcode":"STM","geonameId":3380725,"lat":4.8,"population":0,"adminName1":""},{"countryName":"Greenland","adminCode1":"02","fclName":"stream, lake, ...","countryCode":"GL","lng":-36.8666667,"fcodeName":"glacier(s)","fcl":"H","name":"Paris Gletscher","fcode":"GLCR","geonameId":3421140,"lat":66.8333333,"population":0,"adminName1":"Østgrønland"},{"countryName":"Netherlands Antilles","adminCode1":"00","fclName":"mountain,hill,rock,... ","countryCode":"AN","lng":-63.25,"fcodeName":"mountain","fcl":"T","name":"Paris Hill","fcode":"MT","geonameId":3513404,"lat":17.6166667,"population":0,"adminName1":""},{"countryName":"Mexico","adminCode1":"05","fclName":"city, village,...","countryCode":"MX","lng":-92.2833333,"fcodeName":"populated place","fcl":"P","name":"París","fcode":"PPL","geonameId":3521888,"lat":15.1333333,"population":0,"adminName1":"Chiapas"},{"countryName":"Colombia","adminCode1":"02","fclName":"mountain,hill,rock,... ","countryCode":"CO","lng":-75.8,"fcodeName":"hill","fcl":"T","name":"París","fcode":"HLL","geonameId":3672842,"lat":6.6333333,"population":0,"adminName1":"Antioquia"},{"countryName":"Panama","adminCode1":"06","fclName":"city, village,...","countryCode":"PA","lng":-80.55,"fcodeName":"populated place","fcl":"P","name":"París","fcode":"PPL","geonameId":3703358,"lat":8.05,"population":0,"adminName1":"Herrera"},{"countryName":"Haiti","adminCode1":"09","fclName":"city, village,...","countryCode":"HT","lng":-72.35,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":3719265,"lat":19.7,"population":0,"adminName1":"Nord"},{"countryName":"Haiti","adminCode1":"14","fclName":"city, village,...","countryCode":"HT","lng":-73.9166667,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":3719266,"lat":18.5,"population":0,"adminName1":"GrandʼAnse"},{"countryName":"Haiti","adminCode1":"12","fclName":"city, village,...","countryCode":"HT","lng":-74.1666667,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":3719267,"lat":18.3,"population":0,"adminName1":"Sud"},{"countryName":"Bolivia","adminCode1":"03","fclName":"city, village,...","countryCode":"BO","lng":-62.4833333,"fcodeName":"populated place","fcl":"P","name":"París","fcode":"PPL","geonameId":3908443,"lat":-13.55,"population":0,"adminName1":"El Beni"},{"countryName":"Bolivia","adminCode1":"03","fclName":"parks,area, ...","countryCode":"BO","lng":-65.2666667,"fcodeName":"locality","fcl":"L","name":"París","fcode":"LCTY","geonameId":3908444,"lat":-11.6333333,"population":0,"adminName1":"El Beni"},{"countryName":"United States","adminCode1":"IN","fclName":"city, village,...","countryCode":"US","lng":-85.6338542,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":4262774,"lat":38.8242234,"population":0,"adminName1":"Indiana"},{"countryName":"United States","adminCode1":"MD","fclName":"city, village,...","countryCode":"US","lng":-76.5827365,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":4364853,"lat":38.7026181,"population":0,"adminName1":"Maryland"},{"countryName":"United States","adminCode1":"MS","fclName":"city, village,...","countryCode":"US","lng":-89.4598017,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":4440269,"lat":34.1787205,"population":0,"adminName1":"Mississippi"},{"countryName":"United States","adminCode1":"VA","fclName":"city, village,...","countryCode":"US","lng":-77.951385,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":4777909,"lat":39.0045526,"population":0,"adminName1":"Virginia"},{"countryName":"United States","adminCode1":"IA","fclName":"city, village,...","countryCode":"US","lng":-92.5924118,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":4870695,"lat":40.7886294,"population":0,"adminName1":"Iowa"},{"countryName":"United States","adminCode1":"IA","fclName":"city, village,...","countryCode":"US","lng":-91.5790568,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":4870696,"lat":42.2386036,"population":0,"adminName1":"Iowa"},{"countryName":"United States","adminCode1":"MI","fclName":"city, village,...","countryCode":"US","lng":-85.5025468,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":5004966,"lat":43.7733539,"population":0,"adminName1":"Michigan"},{"countryName":"United States","adminCode1":"OH","fclName":"city, village,...","countryCode":"US","lng":-81.0512057,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":5166094,"lat":41.1664457,"population":0,"adminName1":"Ohio"},{"countryName":"United States","adminCode1":"OH","fclName":"city, village,...","countryCode":"US","lng":-81.1648244,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":5166095,"lat":40.7975589,"population":0,"adminName1":"Ohio"},{"countryName":"United States","adminCode1":"PA","fclName":"city, village,...","countryCode":"US","lng":-80.5125686,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":5205082,"lat":40.4036795,"population":0,"adminName1":"Pennsylvania"},{"countryName":"United States","adminCode1":"WI","fclName":"city, village,...","countryCode":"US","lng":-88.0514727,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":5266222,"lat":42.6336298,"population":0,"adminName1":"Wisconsin"},{"countryName":"United States","adminCode1":"ID","fclName":"mountain,hill,rock,... ","countryCode":"US","lng":-111.5110447,"fcodeName":"valley","fcl":"T","name":"South Fork Paris Canyon","fcode":"VAL","geonameId":5608173,"lat":42.2227036,"population":0,"adminName1":"Idaho"},{"countryName":"United States","adminCode1":"OR","fclName":"city, village,...","countryCode":"US","lng":-123.7706633,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":5744934,"lat":44.2526208,"population":0,"adminName1":"Oregon"},{"countryName":"Canada","adminCode1":"10","fclName":"stream, lake, ...","countryCode":"CA","lng":-72.044390696,"fcodeName":"lake","fcl":"H","name":"Lac Paris","fcode":"LK","geonameId":6036528,"lat":46.219456662,"population":0,"adminName1":"Quebec"},{"countryName":"Canada","adminCode1":"10","fclName":"stream, lake, ...","countryCode":"CA","lng":-70.199073997,"fcodeName":"lake","fcl":"H","name":"Lac Paris","fcode":"LK","geonameId":6036529,"lat":49.383384116,"population":0,"adminName1":"Quebec"},{"countryName":"Canada","adminCode1":"10","fclName":"stream, lake, ...","countryCode":"CA","lng":-77.145556296,"fcodeName":"lake","fcl":"H","name":"Lac Paris","fcode":"LK","geonameId":6036530,"lat":46.492616714,"population":0,"adminName1":"Quebec"},{"countryName":"Canada","adminCode1":"08","fclName":"parks,area, ...","countryCode":"CA","lng":-80.382973187,"fcodeName":"area","fcl":"L","name":"Paris","fcode":"AREA","geonameId":6098357,"lat":43.20010049,"population":11177,"adminName1":"Ontario"},{"countryName":"Canada","adminCode1":"08","fclName":"stream, lake, ...","countryCode":"CA","lng":-76.599411514,"fcodeName":"stream","fcl":"H","name":"Paris Creek","fcode":"STM","geonameId":6098359,"lat":45.250107222,"population":0,"adminName1":"Ontario"},{"countryName":"Canada","adminCode1":"08","fclName":"stream, lake, ...","countryCode":"CA","lng":-91.05020889,"fcodeName":"lake","fcl":"H","name":"Paris Lake","fcode":"LK","geonameId":6098375,"lat":50.083387166,"population":0,"adminName1":"Ontario"},{"countryName":"Canada","adminCode1":"10","fclName":"stream, lake, ...","countryCode":"CA","lng":-78.273449116,"fcodeName":"stream","fcl":"H","name":"Ruisseau Paris","fcode":"STM","geonameId":6134778,"lat":48.724082726,"population":0,"adminName1":"Quebec"},{"countryName":"Indonesia","adminCode1":"30","fclName":"city, village,...","countryCode":"ID","lng":107.5244444,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":6599661,"lat":-6.2525,"population":0,"adminName1":"West Java"},{"countryName":"Indonesia","adminCode1":"30","fclName":"city, village,...","countryCode":"ID","lng":106.77,"fcodeName":"populated place","fcl":"P","name":"Paris","fcode":"PPL","geonameId":6601248,"lat":-6.8758333,"population":0,"adminName1":"West Java"}]}
View
16 tests/setup.php
@@ -13,10 +13,10 @@
*
* @category Services
* @package Services_GeoNames
- * @author David JEAN LOUIS <izimobil@gmail.com>
- * @copyright 2007 David JEAN LOUIS
+ * @author David Jean Louis <izi@php.net>
+ * @copyright 2008-2009 David Jean Louis
* @license http://opensource.org/licenses/mit-license.php MIT License
- * @version SVN: $Id$
+ * @version CVS: $Id$
* @link http://pear.php.net/package/Services_GeoNames
* @since File available since release 0.1.0
*/
@@ -42,14 +42,20 @@ function Services_GeoNames_factory($testname, $user = null, $token = null)
if (!getenv('SERVICES_GEONAMES_LIVETEST')) {
// test with a mock adapter
- if (Services_GeoNames::$url == 'http://www.example.com/') {
+ $mock = new HTTP_Request2_Adapter_Mock();
+ if ($testname == 'test_other_04') {
+ $resp = new HTTP_Request2_Response('HTTP/1.1 404 Not Found', false);
+ } else if ($testname == 'test_other_07') {
+ $resp = new HTTP_Request2_Response('HTTP/1.1 404 Not Found', false);
+ $mock->addResponse($resp);
+ $resp = new HTTP_Request2_Response('HTTP/1.1 404 Not Found', false);
+ $mock->addResponse($resp);
$resp = new HTTP_Request2_Response('HTTP/1.1 404 Not Found', false);
} else {
$resp = new HTTP_Request2_Response('HTTP/1.1 200 Success', false);
$file = dirname(__FILE__) . '/data/' . $testname . '.dat';
$resp->appendBody(file_get_contents($file));
}
- $mock = new HTTP_Request2_Adapter_Mock();
$mock->addResponse($resp);
$geo->getRequest()->setAdapter($mock);
}
View
4 tests/test_get.phpt
@@ -157,7 +157,7 @@ stdClass Object
[countryName] =>
[adminCode1] => 20
[fclName] => parks,area, ...
- [lng] => 9.00266826153
+ [lng] => 0
[adminName2] =>
[adminName3] =>
[fcodeName] =>
@@ -173,7 +173,7 @@ stdClass Object
[name] => Globe
[fcode] =>
[geonameId] => 6295630
- [lat] => 46.0130881764
+ [lat] => 0
[population] => 0
[adminName1] => null.20
)
View
6 tests/test_hierarchy.phpt
@@ -96,7 +96,7 @@ Array
[12] => stdClass Object
(
- [name] => Mundo
+ [name] => el planeta
[lang] => es
)
@@ -110,7 +110,7 @@ Array
[countryName] =>
[fclName] => parks,area, ...
- [lng] => 9.00266826153
+ [lng] => 0
[adminName2] =>
[adminName3] =>
[fcodeName] =>
@@ -126,7 +126,7 @@ Array
[name] => Globe
[fcode] =>
[geonameId] => 6295630
- [lat] => 46.0130881764
+ [lat] => 0
[population] => 0
[adminName1] =>
)
View
3 tests/test_other_04.phpt
@@ -4,12 +4,13 @@ Test for other code parts 04
<?php
require_once dirname(__FILE__) . '/setup.php';
-Services_GeoNames::$url = 'http://www.example.com/';
$geo = Services_GeoNames_factory(
substr(basename(__FILE__), 0, -4),
'username',
'auth_token'
);
+$geo->url = 'http://www.example.com/';
+
try {
$ret = $geo->search(array('q' => 'kjhkjhkjh'));
} catch (Services_GeoNames_Exception $exc) {
View
2 tests/test_other_05.phpt
@@ -4,8 +4,8 @@ Test for other code parts 05
<?php
require_once 'Services/GeoNames.php';
-Services_GeoNames::$url = 'blah blah...';
$geo = new Services_GeoNames();
+$geo->url = 'Some invalid url...';
try {
$ret = $geo->search(array('q' => 'kjhkjhkjh'));
} catch (Services_GeoNames_HTTPException $exc) {
View
24 tests/test_other_06.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Test for other code parts 06
+--FILE--
+<?php
+require_once dirname(__FILE__) . '/setup.php';
+
+$geo = Services_GeoNames_factory(substr(basename(__FILE__), 0, -4));
+$geo->url = 'http://example.com/1';
+$geo->failoverServers[] = 'http://example.com/2';
+$geo->failoverServers[] = 'http://example.com/3';
+$geo->failoverServers[] = 'http://ws.geonames.org';
+$geo->failoverServers[] = 'http://ws5.geonames.org';
+
+try {
+ $ret = $geo->search(array('q' => 'paris'));
+ var_dump(is_array($ret));
+} catch (Services_GeoNames_HTTPException $exc) {
+ echo $exc->getMessage() . "\n";
+ echo get_class($exc->getCause());
+}
+
+?>
+--EXPECT--
+bool(true)
View
22 tests/test_other_07.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Test for other code parts 06
+--FILE--
+<?php
+require_once dirname(__FILE__) . '/setup.php';
+
+$geo = Services_GeoNames_factory(substr(basename(__FILE__), 0, -4));
+$geo->url = 'http://example.com/1';
+$geo->failoverServers[] = 'http://example.com/2';
+$geo->failoverServers[] = 'http://example.com/3';
+
+try {
+ $ret = $geo->search(array('q' => 'paris'));
+} catch (Services_GeoNames_HTTPException $exc) {
+ echo $exc->getMessage() . "\n";
+ var_dump(count($exc->getCause()) == 3);
+}
+
+?>
+--EXPECT--
+Not Found
+bool(true)

0 comments on commit 73acbc5

Please sign in to comment.