From 91690c4fd99a561799626b14f232d2fbd7abaeda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Thu, 25 Jun 2026 19:53:16 +0300 Subject: [PATCH] =?UTF-8?q?fix/test:=20ProjectServiceGuardWiring=20?= =?UTF-8?q?=E2=80=94=20=D0=BC=D0=BE=D0=BA=20=D0=B6=D0=B4=D1=91=D1=82=20isP?= =?UTF-8?q?rotected=20(=D0=AD=D0=BF=D0=B8=D0=BA=206.2=20=D0=B4=D0=BE=D0=B1?= =?UTF-8?q?=D0=B0=D0=B2=D0=B8=D0=BB=20=D0=B2=D1=8B=D0=B7=D0=BE=D0=B2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Полный прогон бэка поймал: update() теперь зовёт isProtected() до assertCanMutateSource (для уведомления о хвосте, Эпик 6.2), а wiring-мок этого не ждал → Mockery error. Добавлено shouldReceive('isProtected'). 3/3. Единственная регрессия из полного прогона (883 теста). Co-Authored-By: Claude Opus 4.8 (1M context) --- .../Unit/Services/Project/ProjectServiceGuardWiringTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/tests/Unit/Services/Project/ProjectServiceGuardWiringTest.php b/app/tests/Unit/Services/Project/ProjectServiceGuardWiringTest.php index fb9360fb..2d7e1028 100644 --- a/app/tests/Unit/Services/Project/ProjectServiceGuardWiringTest.php +++ b/app/tests/Unit/Services/Project/ProjectServiceGuardWiringTest.php @@ -49,6 +49,9 @@ class ProjectServiceGuardWiringTest extends TestCase public function test_update_invokes_guard_with_change_source_action_when_signal_identifier_changes(): void { $guard = Mockery::mock(SupplierSnapshotGuard::class); + // Эпик 6.2: update() сначала спрашивает isProtected (для уведомления о хвосте), + // затем assertCanMutateSource. Допускаем оба вызова. + $guard->shouldReceive('isProtected')->andReturn(true); $guard->shouldReceive('assertCanMutateSource') ->once() ->with(Mockery::on(fn ($p) => $p instanceof Project && $p->id === 100), 'change_source')