diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-07-20 03:48:50 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-07-20 03:48:50 +0900 |
| commit | 7225d0b9f9f0428d3ba5eb04f0327ca60ac6a389 (patch) | |
| tree | 2d4b932e8cf37db613c866038681862d6480d084 /crates/shirabe | |
| parent | f90900604b35cb4ecc04ce224ad64f74c2132aaa (diff) | |
| download | php-shirabe-7225d0b9f9f0428d3ba5eb04f0327ca60ac6a389.tar.gz php-shirabe-7225d0b9f9f0428d3ba5eb04f0327ca60ac6a389.tar.zst php-shirabe-7225d0b9f9f0428d3ba5eb04f0327ca60ac6a389.zip | |
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 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe')
| -rw-r--r-- | crates/shirabe/tests/event_dispatcher/event_dispatcher_test.rs | 20 |
1 files changed, 12 insertions, 8 deletions
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!() } |
