Skip to content

Commit 52dd951

Browse files
committed
Fix GH-8426: make test fail while soap extension build
If you build soap as a shared object, then these tests fail on non-Windows, or when the PHP install hasn't been make install-ed yet, but is executed from the development directory.
1 parent 81e50b4 commit 52dd951

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

ext/soap/tests/bug73037.phpt

+6-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,12 @@ function get_data($max)
5959
}
6060

6161
$router = "bug73037_server.php";
62-
$args = substr(PHP_OS, 0, 3) == 'WIN'
63-
? ["-d", "extension_dir=" . ini_get("extension_dir"), "-d", "extension=php_soap.dll"] : [];
62+
$args = ["-d", "extension_dir=" . ini_get("extension_dir"), "-d", "extension=" . (substr(PHP_OS, 0, 3) == "WIN" ? "php_" : "") . "soap." . PHP_SHLIB_SUFFIX];
63+
if (php_ini_loaded_file()) {
64+
// Necessary such that it works from a development directory in which case extension_dir might not be the real extension dir
65+
$args[] = "-c";
66+
$args[] = php_ini_loaded_file();
67+
}
6468
$code = <<<'PHP'
6569
$s = new SoapServer(NULL, array('uri' => 'http://here'));
6670
$s->setObject(new stdclass());

ext/soap/tests/custom_content_type.phpt

+6-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@ soap
1313

1414
include __DIR__ . "/../../../sapi/cli/tests/php_cli_server.inc";
1515

16-
$args = substr(PHP_OS, 0, 3) == 'WIN'
17-
? ["-d", "extension_dir=" . ini_get("extension_dir"), "-d", "extension=php_soap.dll"] : [];
16+
$args = ["-d", "extension_dir=" . ini_get("extension_dir"), "-d", "extension=" . (substr(PHP_OS, 0, 3) == "WIN" ? "php_" : "") . "soap." . PHP_SHLIB_SUFFIX];
17+
if (php_ini_loaded_file()) {
18+
// Necessary such that it works from a development directory in which case extension_dir might not be the real extension dir
19+
$args[] = "-c";
20+
$args[] = php_ini_loaded_file();
21+
}
1822
$code = <<<'PHP'
1923
/* Receive */
2024
$content = trim(file_get_contents("php://input")) . PHP_EOL;

0 commit comments

Comments
 (0)