From 8fe3390d064303b86133a1d2983144a4818a7121 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Tue, 23 Jun 2026 03:49:00 +0900 Subject: test(command): port InitCommandTest Port the pure-method cases (parse/namespace/formatAuthors/git/vendor-ignore) and build the ApplicationTester / initTempComposer harness the run cases need. Supporting production changes: - carry the streamable input stream as PhpResource (not PhpMixed) and add InputInterface::as_streamable so QuestionHelper reads the injected stream - add StreamOutput/ConsoleOutput __set_stream test helpers and ApplicationHandle::set_catch_exceptions for the tester - implement the interact() author validator via parse_author_string Co-Authored-By: Claude Opus 4.8 (1M context) --- .../src/symfony/console/input/array_input.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'crates/shirabe-external-packages/src/symfony/console/input/array_input.rs') diff --git a/crates/shirabe-external-packages/src/symfony/console/input/array_input.rs b/crates/shirabe-external-packages/src/symfony/console/input/array_input.rs index 3fc9abb..327650b 100644 --- a/crates/shirabe-external-packages/src/symfony/console/input/array_input.rs +++ b/crates/shirabe-external-packages/src/symfony/console/input/array_input.rs @@ -5,6 +5,7 @@ use crate::symfony::console::exception::invalid_option_exception::InvalidOptionE use crate::symfony::console::input::input::Input; use crate::symfony::console::input::input_definition::InputDefinition; use crate::symfony::console::input::input_interface::InputInterface; +use crate::symfony::console::input::streamable_input_interface::StreamableInputInterface; use indexmap::IndexMap; use shirabe_php_shim::PhpMixed; @@ -373,6 +374,20 @@ impl InputInterface for ArrayInput { fn set_interactive(&mut self, interactive: bool) { self.inner.set_interactive(interactive) } + + fn as_streamable(&self) -> Option<&dyn StreamableInputInterface> { + Some(self) + } +} + +impl StreamableInputInterface for ArrayInput { + fn set_stream(&mut self, stream: shirabe_php_shim::PhpResource) { + self.inner.set_stream(stream) + } + + fn get_stream(&self) -> Option { + self.inner.get_stream() + } } /// PHP `(array) $values` cast: a string becomes a single-element array. -- cgit v1.3.1