aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-external-packages/src/symfony/console/output/console_output.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-23 03:49:00 +0900
committernsfisis <nsfisis@gmail.com>2026-06-23 03:49:29 +0900
commit8fe3390d064303b86133a1d2983144a4818a7121 (patch)
tree3d7979e8fcce3db28ec9edc9b1ce16a593026454 /crates/shirabe-external-packages/src/symfony/console/output/console_output.rs
parentc644aa4df0dfcd58e3f0a1372611921678ed6c6d (diff)
downloadphp-shirabe-8fe3390d064303b86133a1d2983144a4818a7121.tar.gz
php-shirabe-8fe3390d064303b86133a1d2983144a4818a7121.tar.zst
php-shirabe-8fe3390d064303b86133a1d2983144a4818a7121.zip
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) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-external-packages/src/symfony/console/output/console_output.rs')
-rw-r--r--crates/shirabe-external-packages/src/symfony/console/output/console_output.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/shirabe-external-packages/src/symfony/console/output/console_output.rs b/crates/shirabe-external-packages/src/symfony/console/output/console_output.rs
index 0808fef..dd6840d 100644
--- a/crates/shirabe-external-packages/src/symfony/console/output/console_output.rs
+++ b/crates/shirabe-external-packages/src/symfony/console/output/console_output.rs
@@ -110,6 +110,13 @@ impl ConsoleOutput {
shirabe_php_shim::stripos(&shirabe_php_shim::implode(";", &checks), "OS400").is_some()
}
+ /// For testing only. Overwrites the inner `StreamOutput`'s private `stream` field, mirroring
+ /// what `Symfony\Component\Console\Tester\TesterTrait::initOutput` does via reflection on the
+ /// parent `StreamOutput::$stream` property of a `ConsoleOutput`.
+ pub fn __set_stream(&mut self, stream: shirabe_php_shim::PhpResource) {
+ self.inner.__set_stream(stream);
+ }
+
fn open_output_stream() -> shirabe_php_shim::PhpResource {
if !Self::has_stdout_support() {
return shirabe_php_shim::php_fopen_resource("php://output", "w");