From 25f96cab45f5da4fba2ef0486a0b0bc8f7ca87b0 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 21 Jun 2026 05:09:56 +0900 Subject: test: port downloader/installer/io/json/event-dispatcher/functional stubs All ignored: these mock IO/HttpDownloader (curl)/ProcessExecutor/installers, use ZipArchive/JsonManipulator todo!()s, need Symfony console or schema validation, reflect into ClassLoader, or run end-to-end install/functional fixtures. Wires up the event_dispatcher test target. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../event_dispatcher/event_dispatcher_test.rs | 29 ++++++++++++++++++++++ crates/shirabe/tests/event_dispatcher/main.rs | 1 + 2 files changed, 30 insertions(+) create mode 100644 crates/shirabe/tests/event_dispatcher/main.rs (limited to 'crates/shirabe/tests/event_dispatcher') diff --git a/crates/shirabe/tests/event_dispatcher/event_dispatcher_test.rs b/crates/shirabe/tests/event_dispatcher/event_dispatcher_test.rs index 1194da4..86e33f2 100644 --- a/crates/shirabe/tests/event_dispatcher/event_dispatcher_test.rs +++ b/crates/shirabe/tests/event_dispatcher/event_dispatcher_test.rs @@ -1 +1,30 @@ //! ref: composer/tests/Composer/Test/EventDispatcher/EventDispatcherTest.php + +// These build an EventDispatcher with a mocked Composer/IO/ProcessExecutor and run script +// listeners (executing CLI/PHP callbacks); mocking and the script-execution machinery are +// not available here. +macro_rules! stub { + ($name:ident) => { + #[test] + #[ignore = "mocks Composer/IO/ProcessExecutor and executes script listeners; not ported"] + fn $name() { + todo!() + } + }; +} + +stub!(test_listener_exceptions_are_caught); +stub!(test_dispatcher_can_execute_single_command_line_script); +stub!(test_dispatcher_pass_dev_mode_to_autoload_generator_for_script_events); +stub!(test_dispatcher_remove_listener); +stub!(test_dispatcher_can_execute_cli_and_php_in_same_event_script_stack); +stub!(test_dispatcher_can_put_env); +stub!(test_dispatcher_appends_dir_bin_on_path_for_every_listener); +stub!(test_dispatcher_support_for_additional_args); +stub!(test_dispatcher_can_execute_composer_script_groups); +stub!(test_recursion_in_scripts_names); +stub!(test_dispatcher_detect_infinite_recursion); +stub!(test_dispatcher_outputs_command); +stub!(test_dispatcher_outputs_error_on_failed_command); +stub!(test_dispatcher_installer_events); +stub!(test_dispatcher_doesnt_return_skipped_scripts); diff --git a/crates/shirabe/tests/event_dispatcher/main.rs b/crates/shirabe/tests/event_dispatcher/main.rs new file mode 100644 index 0000000..d5d096a --- /dev/null +++ b/crates/shirabe/tests/event_dispatcher/main.rs @@ -0,0 +1 @@ +mod event_dispatcher_test; -- cgit v1.3.1