Skip to content

Commit e069289

Browse files
author
zhao.binyan
committed
update tests
1 parent 1b074df commit e069289

2 files changed

Lines changed: 10 additions & 12 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
}
2727
],
2828
"require": {
29-
"php": ">=5.3.3"
29+
"php": "~5.4|~7.0"
3030
},
3131
"autoload": {
3232
"psr-4": {

tests/ip.php

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,18 @@
99

1010
use itbdw\Ip\IpLocation;
1111

12-
$hostnames = [
13-
'google.com',
14-
'weibo.com',
15-
'nothing',
12+
$ips = [
13+
"172.217.25.14",//美国
14+
"140.205.172.5",//杭州
15+
"123.125.115.110",//北京
16+
"221.196.0.0",//
17+
"60.195.153.98",
1618
];
17-
shuffle($hostnames);
18-
$hostname = array_pop($hostnames);
1919

20-
$ip = gethostbyname($hostname);
20+
foreach ($ips as $ip) {
2121

22-
echo $hostname . "\n";
22+
echo json_encode(IpLocation::getLocation($ip), JSON_UNESCAPED_UNICODE) . "\n";
2323

24-
$qqwry_path = dirname(__DIR__) . '/src/qqwry.dat';
24+
}
2525

26-
echo json_encode(IpLocation::getLocation($ip), JSON_UNESCAPED_UNICODE) . "\n";
27-
echo json_encode(IpLocation::getLocation($ip, $qqwry_path), JSON_UNESCAPED_UNICODE) . "\n";
2826

0 commit comments

Comments
 (0)