<?php
/**
* Owner: Principe Orazio
* Date: 20/05/16
* Time: 09:20
*
* Test file for ItalianCities class
*/
require_once ("ItalianCities.php");
$ic = new ItalianCites();
//Just for this example we can get max. 2 records for each call
$records = 2;
//Search by city
$city = "Roma";
$results = $ic->getCurlResults($city,null,null,$records);
var_dump($results);
echo "<hr>";
//Search by postalCode
$postalCode = "01034";
$results = $ic->getCurlResults(null,null,$postalCode,$records);
var_dump($results);
echo "<hr>";
//Search by city and address
$city = "Roma";
$address = "Via Aurelia";
$results = $ic->getCurlResults($city,$address,null,$records);
var_dump($results);
echo "<hr>";
//Test city and cap -> correct
$city = "Roma";
$postalCode = "00199";
$results = $ic->verify($city,null,$postalCode);
var_dump($results);
echo "<hr>";
//Test city and cap -> wrong
$city = "Roma";
$postalCode = "10100";
$results = $ic->verify($city,null,$postalCode);
var_dump($results);
|