summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohn Boehr <jbboehr@gmail.com>2017-08-06 15:04:36 -0700
committerAnatol Belski <ab@php.net>2017-08-18 17:34:48 +0200
commit59558ffd961c5002be5cf99245c6c76be569cf1e (patch)
treea0e3ee40cb7df3f9cff0d0be61c477a6171092ac /tests
parentdebbaba93f3c8bbc1ca02744c3489800e7dfd76a (diff)
downloadphp-git-59558ffd961c5002be5cf99245c6c76be569cf1e.tar.gz
Fix issues with phpt and EXTENSION on windows (BUG 75042)
* Commands are not properly escaped for windows * Specifying "-n" to check loaded modules causes "Module already loaded" warning * Extensions to be loaded need the "php_" prefix on Windows Bug: https://bugs.php.net/bug.php?id=75042 Add back -n flag to fetch loaded extensions in run-tests.php Add test for phpt EXTENSIONS directive Add a second test for bug 75042 Add test to test loading of nonexistent shared module with the EXTENSIONS phpt block Pass ini settings when checking loaded extensions
Diffstat (limited to 'tests')
-rw-r--r--tests/run-test/bug75042-2.phpt18
-rw-r--r--tests/run-test/bug75042-3.phpt8
-rw-r--r--tests/run-test/bug75042.phpt20
3 files changed, 46 insertions, 0 deletions
diff --git a/tests/run-test/bug75042-2.phpt b/tests/run-test/bug75042-2.phpt
new file mode 100644
index 0000000000..c79eb4495f
--- /dev/null
+++ b/tests/run-test/bug75042-2.phpt
@@ -0,0 +1,18 @@
+--TEST--
+phpt EXTENSIONS directive with static module
+--SKIPIF--
+<?php
+if(empty($_ENV['TEST_PHP_EXECUTABLE'])) {
+ die('skip TEST_PHP_EXECUTABLE not set');
+}
+$php = $_ENV['TEST_PHP_EXECUTABLE'];
+if (false === stripos(`$php -n -m`, 'spl')) {
+ die('skip spl is NOT built static');
+}
+--EXTENSIONS--
+SPL
+--FILE--
+<?php
+var_dump(extension_loaded('spl'));
+--EXPECT--
+bool(true) \ No newline at end of file
diff --git a/tests/run-test/bug75042-3.phpt b/tests/run-test/bug75042-3.phpt
new file mode 100644
index 0000000000..76ec2b5ff0
--- /dev/null
+++ b/tests/run-test/bug75042-3.phpt
@@ -0,0 +1,8 @@
+--TEST--
+phpt EXTENSIONS directive with nonexistent shared module
+--EXTENSIONS--
+nonexistentsharedmodule
+--FILE--
+<?php
+--EXPECTF--
+PHP Warning: PHP Startup: Unable to load dynamic library '%snonexistentsharedmodule.%s' %A \ No newline at end of file
diff --git a/tests/run-test/bug75042.phpt b/tests/run-test/bug75042.phpt
new file mode 100644
index 0000000000..10a0f45040
--- /dev/null
+++ b/tests/run-test/bug75042.phpt
@@ -0,0 +1,20 @@
+--TEST--
+phpt EXTENSIONS directive with shared module
+--SKIPIF--
+<?php
+if(empty($_ENV['TEST_PHP_EXECUTABLE'])) {
+ die('skip TEST_PHP_EXECUTABLE not set');
+}
+$php = $_ENV['TEST_PHP_EXECUTABLE'];
+if (false !== stripos(`$php -n -m`, 'openssl')) {
+ die('skip openssl is built static');
+}
+$ext_module = ini_get('extension_dir') . DIRECTORY_SEPARATOR . (substr(PHP_OS, 0, 3) === "WIN" ? "php_openssl." : "openssl.") . PHP_SHLIB_SUFFIX;
+if( !file_exists($ext_module) ) die('skip openssl shared extension not found');
+--EXTENSIONS--
+openssl
+--FILE--
+<?php
+var_dump(extension_loaded('openssl'));
+--EXPECT--
+bool(true) \ No newline at end of file