added testsuite for verifying handlers

This commit is contained in:
sparc 2006-02-01 19:18:17 +00:00
parent 520a88bff0
commit 5377e5f567
3 changed files with 63 additions and 2 deletions

View file

@ -2,6 +2,7 @@
- fixed README documentation
- improved .au handler for user with
whois-check.ausregistry.net.au
- added testsuite for verifying handlers
2006/01/31 David Saez <david@ols.es>
- fixed lookup error on .co.za domains

View file

@ -60,13 +60,13 @@ tvcorp sex.tv
aero nic.aero
biz neulevel.biz
cat domini.cat
coop sex.coop , nic.coop
coop sex.coop nic.coop
info afilias.info
int who.int
museum nic.museum
name peter.morgan.name
org example.org
pro registrypro.pr
pro registrypro.pro
travel nic.travel
// IP whois

60
testsuite.php Executable file
View file

@ -0,0 +1,60 @@
#!/usr/local/bin/php -n
<?php
/*
Whois.php PHP classes to conduct whois queries
Copyright (C)1999,2005 easyDNS Technologies Inc. & Mark Jeftovic
Maintained by David Saez (david@ols.es)
For the most recent version of this package visit:
http://www.phpwhois.org
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
include('whois.main.php');
$whois = new Whois();
$lines = file('./test.txt');
$domains = array();
foreach ($lines as $key => $line)
{
$pos = strpos($line,'/');
if ($pos !== false) $line = substr($line,0,$pos);
$line = trim($line);
if ($line=='') continue;
$parts = explode(' ',str_replace("\t",' ',$line));
for ($i=1;$i<count($parts);$i++)
if ($parts[$i]!='')
$domains[] = $parts[$i];
}
foreach ($domains as $key => $domain)
{
echo "\nTesting $domain ---------------------------------\n";
$result = $whois->Lookup($domain);
print_r($result);
}
?>