Skip to content

Commit 6ba0b06

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. Closes GH-11211.
1 parent 78ec64a commit 6ba0b06

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ PHP NEWS
2323
- PGSQL:
2424
. Fixed parameter parsing of pg_lo_export(). (kocsismate)
2525

26+
- Soap:
27+
. Fixed bug GH-8426 (make test fail while soap extension build). (nielsdos)
28+
2629
- SPL:
2730
. Fixed bug GH-11178 (Segmentation fault in spl_array_it_get_current_data
2831
(PHP 8.1.18)). (nielsdos)

ext/soap/tests/bug73037.phpt

Lines changed: 6 additions & 2 deletions
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

Lines changed: 6 additions & 2 deletions
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)