Skip to content

Commit 828dc3d

Browse files
committed
Fix GH-8426: make test fail while soap extention 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 828dc3d

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

ext/soap/tests/bug73037.phpt

+6-3
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,17 @@ 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());
6771
$s->handle();
6872
PHP;
69-
7073
php_cli_server_start($code, $router, $args);
7174

7275
foreach (array(1024-1, 1024*8-3, 1024*9+1, 1024*16-1, 1024*32-5, 1024*64+3, 1024*128-7) as $k => $i) {

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)