aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/tests/command
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-07-26 00:18:54 +0900
committernsfisis <nsfisis@gmail.com>2026-07-26 00:18:54 +0900
commited0da7fcc3056ce5a822ac0de63ccc2dc799006e (patch)
tree8689fb2797c3d9ced9b89a54753ad5d780c32cd5 /crates/shirabe/tests/command
parentf642329554cf18734e671dc4758bc045de489999 (diff)
downloadphp-shirabe-ed0da7fcc3056ce5a822ac0de63ccc2dc799006e.tar.gz
php-shirabe-ed0da7fcc3056ce5a822ac0de63ccc2dc799006e.tar.zst
php-shirabe-ed0da7fcc3056ce5a822ac0de63ccc2dc799006e.zip
feat(diagnose-command): query the real PHP runtime in one RPC call
diagnose used to read hardcoded shim stubs, so it described a fictional runtime: OPENSSL_VERSION_NUMBER was always 0 and tripped the TLSv1.1/1.2 check, PHP_BINARY and OPENSSL_VERSION_TEXT were empty, and the extension, function and ini probes answered from a fixed table. The PHP worker gained a `diagnose` entry that returns every fact the command needs as one PHP array, cached in a OnceLock so the several call sites share a single round trip. Reading it back needed array support in the serialize() parser, which in turn lets get_loaded_extensions and get_all_ini_files return real lists instead of comma-joined strings. Also fixes the openssl_version message, which dropped strstr()'s before_needle argument during the port, and check_connectivity's allow_url_fopen test, which did not follow PHP string truthiness. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/tests/command')
-rw-r--r--crates/shirabe/tests/command/diagnose_command_test.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/crates/shirabe/tests/command/diagnose_command_test.rs b/crates/shirabe/tests/command/diagnose_command_test.rs
index f1bb2ef5..71f3aa07 100644
--- a/crates/shirabe/tests/command/diagnose_command_test.rs
+++ b/crates/shirabe/tests/command/diagnose_command_test.rs
@@ -46,11 +46,12 @@ Checking github.com rate limit: "
#[test]
#[serial]
-#[ignore = "shirabe_php_shim::OPENSSL_VERSION_NUMBER is a hardcoded stub (0), which always trips \
- check_platform's `< 0x1000100f` TLSv1.1/1.2 support check regardless of the real \
- linked OpenSSL, forcing a non-zero exit code; diagnose also checks live http/https \
- connectivity to packagist and the github.com rate limit (as the PHP original does), \
- so the test additionally requires real network access"]
+#[ignore = "check_composer_audit locates Composer's own vendor/composer/installed.json through a \
+ literal relative path standing in for PHP's __DIR__, so it is never found from the \
+ temporary working directory this test runs in; diagnose then reports a warning and \
+ exits non-zero. diagnose also checks live http/https connectivity to packagist and \
+ the github.com rate limit (as the PHP original does), so the test additionally \
+ requires real network access"]
fn test_cmd_success() {
let tear_down = init_temp_composer(
Some(&serde_json::json!({