You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-php/pecl-geoip/files/fix-failing-tests-php8-1-1....

72 lines
2.4 KiB

diff --git a/tests/014.phpt b/tests/014.phpt
index 40f3ef8..93bc1f7 100644
--- a/tests/014.phpt
+++ b/tests/014.phpt
@@ -8,10 +8,9 @@ Checking timezone info with (some) empty fields
<?php
var_dump(geoip_time_zone_by_country_and_region('US','MA'));
-var_dump(geoip_time_zone_by_country_and_region('US',NULL));
+var_dump(geoip_time_zone_by_country_and_region('US',''));
var_dump(geoip_time_zone_by_country_and_region('DE'));
-var_dump(geoip_time_zone_by_country_and_region(NULL,''));
-var_dump(geoip_time_zone_by_country_and_region(NULL,NULL));
+var_dump(geoip_time_zone_by_country_and_region('',''));
?>
--EXPECTF--
@@ -21,6 +20,3 @@ string(%d) "Europe/%s"
Warning: geoip_time_zone_by_country_and_region(): You need to specify at least the country code. in %s on line %d
bool(false)
-
-Warning: geoip_time_zone_by_country_and_region(): You need to specify at least the country code. in %s on line %d
-bool(false)
diff --git a/tests/016.phpt b/tests/016.phpt
index 83c5250..9b2f056 100644
--- a/tests/016.phpt
+++ b/tests/016.phpt
@@ -8,10 +8,8 @@ Checking geoip_region_name_by_code with (some) empty fields
<?php
var_dump(geoip_region_name_by_code('CA',''));
-var_dump(geoip_region_name_by_code('CA',NULL));
var_dump(geoip_region_name_by_code('CA',1));
var_dump(geoip_region_name_by_code('','QC'));
-var_dump(geoip_region_name_by_code(NULL,'QC'));
var_dump(geoip_region_name_by_code(1,'QC'));
?>
@@ -19,12 +17,6 @@ var_dump(geoip_region_name_by_code(1,'QC'));
Warning: geoip_region_name_by_code(): You need to specify the country and region codes. in %s on line %d
bool(false)
-
-Warning: geoip_region_name_by_code(): You need to specify the country and region codes. in %s on line %d
-bool(false)
-bool(false)
-
-Warning: geoip_region_name_by_code(): You need to specify the country and region codes. in %s on line %d
bool(false)
Warning: geoip_region_name_by_code(): You need to specify the country and region codes. in %s on line %d
diff --git a/tests/019.phpt b/tests/019.phpt
new file mode 100644
index 0000000..9493ea3
--- /dev/null
+++ b/tests/019.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Checking geoip_country_code_by_name_v6 (if IPv6 DB installed)
+--SKIPIF--
+<?php if (!extension_loaded("geoip") || !defined("GEOIP_COUNTRY_EDITION_V6") || !geoip_db_avail(GEOIP_COUNTRY_EDITION_V6)) print "skip"; ?>
+--INI--
+--FILE--
+<?php
+
+var_dump( geoip_country_code_by_name_v6('2001:4860:4860::8888') );
+
+?>
+--EXPECT--
+string(2) "US"