From 7137da4a2e4ca678e9b45bc130d0f3842c703241 Mon Sep 17 00:00:00 2001 From: Nikolay Strikhar Date: Mon, 24 Aug 2026 15:13:48 +0200 Subject: [PATCH] Prove the recorder that pins the guard check ahead of the dependency check --- tests/unit/LoaderTest.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/unit/LoaderTest.php b/tests/unit/LoaderTest.php index 57eec04..d7828b3 100644 --- a/tests/unit/LoaderTest.php +++ b/tests/unit/LoaderTest.php @@ -372,6 +372,16 @@ public function test_an_already_loaded_sub_plugin_is_not_dependency_checked(): v $this->assertSame( 0, $checked ); $this->assertSame( [], $this->queued_notices(), 'No notice for a plugin that is already running.' ); + + // The recorder has to be shown to work, and shown through the path the load pass skipped: a + // mistyped config key, a fixture that dropped the override, a Sub_Plugin that stopped reading + // `dependency_check` at all — each leaves this counter at zero for a reason that has nothing + // to do with the gate order, and this is the only test pinning the order that carries the + // whole re-declaration guarantee. Calling a local closure would prove none of them, since it + // is the registered object's copy that the gate order is about. + $this->assertFalse( Absorber::all()['give-recurring']->are_dependencies_met() ); + + $this->assertSame( 1, $checked, 'The recorder must catch a call that really happened.' ); } public function test_the_should_load_filter_can_veto_the_load(): void {