diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-04 05:09:02 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-04 05:43:30 +0900 |
| commit | 850b67c048bbf80d9739520d950f4dd1ed4190a5 (patch) | |
| tree | 8590335f6b959d0ec025c85b5e1236d542663fd0 /crates/shirabe/tests | |
| parent | 4805053a2b519ac984f3ee0ee449e9fc1271f9cf (diff) | |
| download | php-shirabe-850b67c048bbf80d9739520d950f4dd1ed4190a5.tar.gz php-shirabe-850b67c048bbf80d9739520d950f4dd1ed4190a5.tar.zst php-shirabe-850b67c048bbf80d9739520d950f4dd1ed4190a5.zip | |
test(plugin): tolerate the _composer_tmp rename in the removal test
The PHP worker is shared across the test binary, so whichever subscriber
test runs first owns the bare class name and every later install registers
the plugin under a _composer_tmpN rename (as upstream does). The exact-name
lookup made the removal test depend on lock acquisition order.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/tests')
| -rw-r--r-- | crates/shirabe/tests/plugin/subscriber_test.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crates/shirabe/tests/plugin/subscriber_test.rs b/crates/shirabe/tests/plugin/subscriber_test.rs index 1d6a7ece..a08d8d8d 100644 --- a/crates/shirabe/tests/plugin/subscriber_test.rs +++ b/crates/shirabe/tests/plugin/subscriber_test.rs @@ -104,12 +104,18 @@ fn test_remove_plugin_removes_its_subscribed_listeners() { assert_eq!(0, dispatch(&set_up, "post-install-cmd")); + // The worker is shared across tests: when another test already defined the plugin class, + // this install registered it under a `_composer_tmpN` rename (as upstream does). let plugin = set_up .pm .borrow() .get_plugins() .iter() - .find(|p| p.borrow().get_class_name() == "Subscriber\\Plugin") + .find(|p| { + p.borrow() + .get_class_name() + .starts_with("Subscriber\\Plugin") + }) .expect("the subscriber plugin is registered") .clone(); set_up.pm.borrow_mut().remove_plugin(&plugin).unwrap(); |
