summaryrefslogtreecommitdiffstats
path: root/5.patch
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-11-07 09:41:51 +0100
committerRemi Collet <remi@remirepo.net>2017-11-07 09:41:51 +0100
commit3307dc5bfc6eb492e86b7fe44a404c0d2de51241 (patch)
treef71ce227dd28ce5f7b570c2b512cf66a3a0673fe /5.patch
new package
Diffstat (limited to '5.patch')
-rw-r--r--5.patch101
1 files changed, 101 insertions, 0 deletions
diff --git a/5.patch b/5.patch
new file mode 100644
index 0000000..e430650
--- /dev/null
+++ b/5.patch
@@ -0,0 +1,101 @@
+From 2d3eaa98c1022df06bf667b0284316d73b5e6f00 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Tue, 7 Nov 2017 09:02:35 +0100
+Subject: [PATCH 2/2] add 3 real tests
+
+---
+ tests/cache.phpt | 23 +++++++++++++++++++++++
+ tests/file.phpt | 23 +++++++++++++++++++++++
+ tests/shm.phpt | 23 +++++++++++++++++++++++
+ 3 files changed, 69 insertions(+)
+ create mode 100644 tests/cache.phpt
+ create mode 100644 tests/file.phpt
+ create mode 100644 tests/shm.phpt
+
+diff --git a/tests/cache.phpt b/tests/cache.phpt
+new file mode 100644
+index 0000000..d6c5157
+--- /dev/null
++++ b/tests/cache.phpt
+@@ -0,0 +1,23 @@
++--TEST--
++DB access using cache method
++--SKIPIF--
++<?php
++if(!extension_loaded('ip2location')) die('skip missing extension');
++?>
++--FILE--
++<?php
++/*Test DB access using file mathod*/
++var_dump(ip2location_open(__DIR__ . '/IP-COUNTRY-SAMPLE.BIN'));
++var_dump(ip2location_open_mem(IP2LOCATION_CACHE_MEMORY));
++var_dump(ip2location_get_country_short('25.5.10.2'));
++var_dump(ip2location_get_country_long('25.5.10.2'));
++var_dump(ip2location_close());
++?>
++Done
++--EXPECTF--
++bool(true)
++bool(true)
++string(2) "UK"
++string(14) "UNITED KINGDOM"
++NULL
++Done
+diff --git a/tests/file.phpt b/tests/file.phpt
+new file mode 100644
+index 0000000..6b6bc4c
+--- /dev/null
++++ b/tests/file.phpt
+@@ -0,0 +1,23 @@
++--TEST--
++DB access using file method
++--SKIPIF--
++<?php
++if(!extension_loaded('ip2location')) die('skip missing extension');
++?>
++--FILE--
++<?php
++/*Test DB access using file mathod*/
++var_dump(ip2location_open(__DIR__ . '/IP-COUNTRY-SAMPLE.BIN'));
++var_dump(ip2location_open_mem(IP2LOCATION_FILE_IO));
++var_dump(ip2location_get_country_short('25.5.10.2'));
++var_dump(ip2location_get_country_long('25.5.10.2'));
++var_dump(ip2location_close());
++?>
++Done
++--EXPECTF--
++bool(true)
++bool(true)
++string(2) "UK"
++string(14) "UNITED KINGDOM"
++NULL
++Done
+diff --git a/tests/shm.phpt b/tests/shm.phpt
+new file mode 100644
+index 0000000..056c1d4
+--- /dev/null
++++ b/tests/shm.phpt
+@@ -0,0 +1,23 @@
++--TEST--
++DB access using shared memory method
++--SKIPIF--
++<?php
++if(!extension_loaded('ip2location')) die('skip missing extension');
++?>
++--FILE--
++<?php
++/*Test DB access using file mathod*/
++var_dump(ip2location_open(__DIR__ . '/IP-COUNTRY-SAMPLE.BIN'));
++var_dump(ip2location_open_mem(IP2LOCATION_SHARED_MEMORY));
++var_dump(ip2location_get_country_short('25.5.10.2'));
++var_dump(ip2location_get_country_long('25.5.10.2'));
++var_dump(ip2location_close());
++?>
++Done
++--EXPECTF--
++bool(true)
++bool(true)
++string(2) "UK"
++string(14) "UNITED KINGDOM"
++NULL
++Done