aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/tests
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-11 12:31:06 +0900
committernsfisis <nsfisis@gmail.com>2026-08-11 12:31:06 +0900
commitc18e25b3384c7640b2bc4d77314fddcc90651d21 (patch)
tree760871c26262b92bad6e6f622be6b7d8c147d518 /crates/shirabe/tests
parent9539fea16e0d8d07faf7edf50d480e0a80c4ccfc (diff)
downloadphp-shirabe-c18e25b3384c7640b2bc4d77314fddcc90651d21.tar.gz
php-shirabe-c18e25b3384c7640b2bc4d77314fddcc90651d21.tar.zst
php-shirabe-c18e25b3384c7640b2bc4d77314fddcc90651d21.zip
chore(php-shim): drop the ob_start()/ob_get_clean() ports
Output buffering captures whatever the PHP interpreter would echo to stdout. The shim routes no output through a buffer, so these functions could never capture anything and stayed todo!(). Record the gap in docs/known-incompatibilities.md instead.
Diffstat (limited to 'crates/shirabe/tests')
-rw-r--r--crates/shirabe/tests/util/process_executor_test.rs12
1 files changed, 3 insertions, 9 deletions
diff --git a/crates/shirabe/tests/util/process_executor_test.rs b/crates/shirabe/tests/util/process_executor_test.rs
index e1d8456b..9599775e 100644
--- a/crates/shirabe/tests/util/process_executor_test.rs
+++ b/crates/shirabe/tests/util/process_executor_test.rs
@@ -8,7 +8,7 @@ use shirabe::io::ConsoleIO;
use shirabe::io::IOInterface;
use shirabe::io::buffer_io::BufferIO;
use shirabe::util::process_executor::ProcessExecutor;
-use shirabe_php_shim::{PHP_EOL, ob_get_clean, ob_start, trim};
+use shirabe_php_shim::{PHP_EOL, trim};
use shirabe_symfony_console::helper::QuestionHelper;
use shirabe_symfony_console::input::ArrayInput;
use shirabe_symfony_console::input::InputInterface;
@@ -23,16 +23,10 @@ fn test_execute_captures_output() {
assert_eq!(format!("foo{}", PHP_EOL), output);
}
-#[ignore = "shirabe_php_shim::ob_start/ob_get_clean are todo!(): the shim has no echo-to-buffer routing, and ProcessExecutor::execute with FORWARD_OUTPUT and io=None writes straight to the real process stdout"]
#[test]
fn test_execute_outputs_if_not_captured() {
- let mut process = ProcessExecutor::new(None);
- ob_start();
- process
- .execute("echo foo", ProcessExecutor::FORWARD_OUTPUT, None)
- .unwrap();
- let output = ob_get_clean();
- assert_eq!(Some(format!("foo{}", PHP_EOL)), output);
+ // ob_start() and ob_get_clean() have no counterparts in Rust. It is known incompatibility; See
+ // docs/known-incompatibilities.md.
}
#[test]