aboutsummaryrefslogtreecommitdiff
path: root/vendor/maxmind-db/reader/ext/tests
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/maxmind-db/reader/ext/tests')
-rw-r--r--vendor/maxmind-db/reader/ext/tests/001-load.phpt12
-rw-r--r--vendor/maxmind-db/reader/ext/tests/002-final.phpt13
-rw-r--r--vendor/maxmind-db/reader/ext/tests/003-open-basedir.phpt12
3 files changed, 37 insertions, 0 deletions
diff --git a/vendor/maxmind-db/reader/ext/tests/001-load.phpt b/vendor/maxmind-db/reader/ext/tests/001-load.phpt
new file mode 100644
index 0000000..09810ee
--- /dev/null
+++ b/vendor/maxmind-db/reader/ext/tests/001-load.phpt
@@ -0,0 +1,12 @@
+--TEST--
+Check for maxminddb presence
+--SKIPIF--
+<?php if (!extension_loaded('maxminddb')) {
+ echo 'skip';
+} ?>
+--FILE--
+<?php
+echo 'maxminddb extension is available';
+?>
+--EXPECT--
+maxminddb extension is available
diff --git a/vendor/maxmind-db/reader/ext/tests/002-final.phpt b/vendor/maxmind-db/reader/ext/tests/002-final.phpt
new file mode 100644
index 0000000..d91b7d0
--- /dev/null
+++ b/vendor/maxmind-db/reader/ext/tests/002-final.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Check that Reader class is not final
+--SKIPIF--
+<?php if (!extension_loaded('maxminddb')) {
+ echo 'skip';
+} ?>
+--FILE--
+<?php
+$reflectionClass = new \ReflectionClass('MaxMind\Db\Reader');
+var_dump($reflectionClass->isFinal());
+?>
+--EXPECT--
+bool(false)
diff --git a/vendor/maxmind-db/reader/ext/tests/003-open-basedir.phpt b/vendor/maxmind-db/reader/ext/tests/003-open-basedir.phpt
new file mode 100644
index 0000000..26e9781
--- /dev/null
+++ b/vendor/maxmind-db/reader/ext/tests/003-open-basedir.phpt
@@ -0,0 +1,12 @@
+--TEST--
+openbase_dir is followed
+--INI--
+open_basedir=/--dne--
+--FILE--
+<?php
+use MaxMind\Db\Reader;
+
+$reader = new Reader('/usr/local/share/GeoIP/GeoIP2-City.mmdb');
+?>
+--EXPECTREGEX--
+.*open_basedir restriction in effect.*