From 3a0d9340810a8808d963135a884f50d08442ac67 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 25 Jun 2026 16:27:53 +0900 Subject: test: port 59 autoload/vcs/installer/util/command tests; fix output capture Port autoload_generator (24), bitbucket (14), suggested_packages (11), git_driver (6), archive_manager (3), and a bump command test. Fix the ApplicationTester output-capture root cause (php://memory streams must be readable regardless of fopen mode). Implement posix_getuid/geteuid, the PCRE 'A' anchored modifier, php_strip_whitespace, stream_get_wrappers, is_callable scalars; fix preg_quote angle-bracket escaping and class-map parser regexes. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe-php-shim/src/fs.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'crates/shirabe-php-shim/src/fs.rs') diff --git a/crates/shirabe-php-shim/src/fs.rs b/crates/shirabe-php-shim/src/fs.rs index ee2bbee..5558f58 100644 --- a/crates/shirabe-php-shim/src/fs.rs +++ b/crates/shirabe-php-shim/src/fs.rs @@ -254,12 +254,15 @@ pub fn fopen(file: &str, mode: &str) -> Result { "w" | "a" | "x" | "c" => (false, true), _ => (true, true), // r+, w+, a+, x+, c+, rw, ... }; - // php://memory and php://temp are in-memory streams. + // php://memory and php://temp are in-memory streams. PHP's memory wrapper ignores the read / + // write restrictions implied by the mode: a memory stream opened with "w" is still readable + // (this is what Symfony's ApplicationTester relies on -- it opens "php://memory" with "w" and + // then rewinds + reads it back). So memory streams are always both readable and writable. if file == "php://memory" || file.starts_with("php://temp") { return Ok(StreamState::new( StreamBacking::Memory(std::io::Cursor::new(Vec::new())), - readable, - writable, + true, + true, mode.to_string(), file.to_string(), )); -- cgit v1.3.1