aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/tests
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-07-20 05:21:28 +0900
committernsfisis <nsfisis@gmail.com>2026-07-20 05:21:28 +0900
commit09755004c6d9396f10a5299a013834224da4e3d5 (patch)
treed71d04c6b6ec18413ba48f5e9b7cff8af940d5a4 /crates/shirabe/tests
parenta9070806935a105c69fc7ca255dc9002cf5c2d38 (diff)
downloadphp-shirabe-09755004c6d9396f10a5299a013834224da4e3d5.tar.gz
php-shirabe-09755004c6d9396f10a5299a013834224da4e3d5.tar.zst
php-shirabe-09755004c6d9396f10a5299a013834224da4e3d5.zip
test(run-script-command): detail dev-mode test ignore blockers
Re-verified the reason: besides the missing as_any seam on EventInterface (a cross-cutting trait change over every event type), the mocked dispatchScript call expectation is also inexpressible since dispatch_script is a concrete method with no call-recording seam. Record both blockers in the ignore string and TODO(phase-d) comment. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/tests')
-rw-r--r--crates/shirabe/tests/command/run_script_command_test.rs30
1 files changed, 19 insertions, 11 deletions
diff --git a/crates/shirabe/tests/command/run_script_command_test.rs b/crates/shirabe/tests/command/run_script_command_test.rs
index 71747a4c..6e40bde0 100644
--- a/crates/shirabe/tests/command/run_script_command_test.rs
+++ b/crates/shirabe/tests/command/run_script_command_test.rs
@@ -10,18 +10,26 @@ use shirabe_php_shim::PhpMixed;
/// `ScriptEvent` passed to `hasEventListeners` matches the script name AND its `isDevMode()` equals
/// the computed dev mode (`dev || !noDev`) -- the latter being the whole point of the test.
#[test]
-#[ignore = "PHP asserts the ScriptEvent passed to hasEventListeners has isDevMode() == (dev || !no_dev), \
- but EventInterface (src/event_dispatcher/event.rs:49) has no as_any/downcast seam, so a \
- trait object cannot reach the concrete ScriptEvent::is_dev_mode (src/script/event.rs:51). \
- Reaching it would require adding as_any to EventInterface, i.e. a src change, which is \
- forbidden here -- so the faithful body is currently inexpressible and is left as todo!()."]
+#[ignore = "PHP asserts (a) via mocked hasEventListeners that the ScriptEvent has isDevMode() == \
+ (dev || !no_dev) and (b) via mocked dispatchScript that it is called once with \
+ ($script, $expectedDevMode, []). Neither expectation is expressible: (a) the \
+ __set_get_listeners_override callback only sees &dyn EventInterface \
+ (src/event_dispatcher/event.rs:49), which has no as_any/downcast seam to reach the \
+ concrete ScriptEvent::is_dev_mode (src/script/event.rs:51) -- adding one is a \
+ cross-cutting trait change over every event type, not a small test seam; (b) \
+ dispatch_script is a concrete method with no call-recording seam, and letting the \
+ real one run would execute listeners for real. The faithful body is therefore \
+ inexpressible and is left as todo!()."]
fn test_detect_and_pass_dev_mode_to_event_and_to_dispatching() {
- // TODO(phase-d): PHP asserts the ScriptEvent passed to hasEventListeners has isDevMode() ==
- // (dev || !no_dev), but EventInterface (src/event_dispatcher/event.rs:49) has no as_any/downcast
- // seam, so a trait object cannot reach the concrete ScriptEvent::is_dev_mode
- // (src/script/event.rs:51). Reaching it would require adding as_any to EventInterface, i.e. a
- // src change, which is forbidden here -- so the faithful body is currently inexpressible and is
- // left as todo!().
+ // TODO(phase-d): PHP asserts (a) via mocked hasEventListeners that the ScriptEvent has
+ // isDevMode() == (dev || !no_dev) and (b) via mocked dispatchScript that it is called once
+ // with ($script, $expectedDevMode, []). Neither expectation is expressible: (a) the
+ // __set_get_listeners_override callback only sees &dyn EventInterface
+ // (src/event_dispatcher/event.rs:49), which has no as_any/downcast seam to reach the concrete
+ // ScriptEvent::is_dev_mode (src/script/event.rs:51) -- adding one is a cross-cutting trait
+ // change over every event type, not a small test seam; (b) dispatch_script is a concrete
+ // method with no call-recording seam, and letting the real one run would execute listeners
+ // for real. The faithful body is therefore inexpressible and is left as todo!().
todo!()
}