From 7225d0b9f9f0428d3ba5eb04f0327ca60ac6a389 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 20 Jul 2026 03:48:50 +0900 Subject: test(event-dispatcher): correct dev-mode test ignore reason The old reason blamed missing mock infrastructure, but a spy against dyn AutoloadGeneratorInterface is perfectly writable. The actual blocker is that make_autoloader (PHP makeAutoloader, called from doDispatch's script branches, where setDevMode is invoked) is an intentional no-op in the port, so set_dev_mode is never reached and a spy would observe nothing. Co-Authored-By: Claude Fable 5 --- .../tests/event_dispatcher/event_dispatcher_test.rs | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'crates/shirabe/tests') diff --git a/crates/shirabe/tests/event_dispatcher/event_dispatcher_test.rs b/crates/shirabe/tests/event_dispatcher/event_dispatcher_test.rs index c5caf9f3..c84762a0 100644 --- a/crates/shirabe/tests/event_dispatcher/event_dispatcher_test.rs +++ b/crates/shirabe/tests/event_dispatcher/event_dispatcher_test.rs @@ -322,11 +322,10 @@ fn test_dispatcher_doesnt_return_skipped_scripts() { let _ = &mut event; } -// The remaining tests drive listeners that invoke PHP scripts (`Class::method`), require a -// PHPUnit-style spy on AutoloadGenerator::setDevMode, run real shell commands through an unmocked -// ProcessExecutor, or rely on ReflectionMethod / object-identity callables. None of those seams -// exist in the Rust port (the PHP-script invocation path is an unimplemented plugin-runtime `todo!`), -// so they remain ignored. +// The remaining ignored tests drive listeners that invoke PHP scripts (`Class::method`), require +// the autoloader rebuild of `make_autoloader` (an intentional no-op in the port), or rely on +// ReflectionMethod / object-identity callables. None of those seams exist in the Rust port (the +// PHP-script invocation path is an unimplemented plugin-runtime `todo!`), so they remain ignored. #[test] #[ignore = "listener `EventDispatcherTest::call` is a PHP-script callable; dynamic static-method invocation requires the plugin runtime (execute_event_php_script is todo!())"] @@ -338,11 +337,16 @@ fn test_listener_exceptions_are_caught() { } #[test] -#[ignore = "requires a PHPUnit spy on AutoloadGenerator::setDevMode plus Event::isDevMode mocking; no mock infrastructure exists"] +#[ignore = "EventDispatcher::make_autoloader (PHP makeAutoloader, called from doDispatch's script branches) is an intentional no-op in the port, so AutoloadGeneratorInterface::set_dev_mode is never invoked and a set_dev_mode spy would observe nothing"] fn test_dispatcher_pass_dev_mode_to_autoload_generator_for_script_events() { let _tear_down = TearDown; - // TODO(phase-d): requires a PHPUnit spy on AutoloadGenerator::setDevMode plus Event::isDevMode - // mocking; no mock infrastructure exists + // TODO(phase-d): the PHP test spies on AutoloadGenerator::setDevMode, which PHP calls from + // makeAutoloader (invoked from doDispatch's script branches; it rebuilds and registers the + // project autoloader — loader->unregister, setDevMode(event->isDevMode()), buildPackageMap, + // parseAutoloads, createLoader->register — so that PHP-script listeners can be invoked). The + // Rust EventDispatcher::make_autoloader is an intentional no-op (see its TODO(plugin) + // marker), so set_dev_mode is never reached. A spy could be written against + // `dyn AutoloadGeneratorInterface` once make_autoloader does the real work. todo!() } -- cgit v1.3.1