Skip to content

Commit def6fa7

Browse files
committed
ext/filter: make sure filter.so is loaded when invoking PHP inside a phpt test
The test-suite uses `-d extension_dir=...` & `-d extension=...` to make sure the correct extension is loaded. This change also introduces this behavior for the new regression tests. This in fact bit the nixpkgs build while updating to the earlier-released patches since we have split off most extension builds from core.
1 parent a34a205 commit def6fa7

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

‎ext/filter/tests/oom_filter_default_encoded.phpt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ function oom_post_encoded(string $body, string $script): void
2626
'-d', 'html_errors=0',
2727
'-d', 'filter.default=encoded',
2828
'-d', 'filter.default_flags=0',
29+
'-d', sprintf("extension_dir=%s", ini_get('extension_dir')),
30+
'-d', 'extension=filter.so',
2931
/* the conversion is what is under test, not the deprecation */
3032
'-d', 'error_reporting=' . (E_ALL & ~E_DEPRECATED),
3133
],

‎ext/filter/tests/oom_filter_input.phpt‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ $body = "--$boundary\r\nContent-Disposition: form-data; name=\"k\"\r\n\r\n"
2323
. "\r\n--$boundary--\r\n";
2424

2525
$p = proc_open(
26-
[getenv('TEST_PHP_CGI_EXECUTABLE'), '-n', '-d', 'memory_limit=12M', '-d', 'html_errors=0'],
26+
[
27+
getenv('TEST_PHP_CGI_EXECUTABLE'), '-n',
28+
'-d', 'memory_limit=12M',
29+
'-d', 'html_errors=0',
30+
'-d', sprintf("extension_dir=%s", ini_get('extension_dir')),
31+
'-d', 'extension=filter.so',
32+
],
2733
[0 => ['pipe', 'r'], 1 => ['pipe', 'w'], 2 => ['pipe', 'w']],
2834
$pipes,
2935
null,

‎ext/filter/tests/oom_filter_input_array.phpt‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ $body = "--$boundary\r\nContent-Disposition: form-data; name=\"k\"\r\n\r\n"
2323
. "\r\n--$boundary--\r\n";
2424

2525
$p = proc_open(
26-
[getenv('TEST_PHP_CGI_EXECUTABLE'), '-n', '-d', 'memory_limit=12M', '-d', 'html_errors=0'],
26+
[
27+
getenv('TEST_PHP_CGI_EXECUTABLE'), '-n',
28+
'-d', 'memory_limit=12M',
29+
'-d', 'html_errors=0',
30+
'-d', sprintf("extension_dir=%s", ini_get('extension_dir')),
31+
'-d', 'extension=filter.so',
32+
],
2733
[0 => ['pipe', 'r'], 1 => ['pipe', 'w'], 2 => ['pipe', 'w']],
2834
$pipes,
2935
null,

0 commit comments

Comments
 (0)