From 239727e4edf90727d315f78578b149583032523a Mon Sep 17 00:00:00 2001 From: Simon Hamp Date: Fri, 23 Oct 2026 12:10:39 +0100 Subject: [PATCH] Count only the matching warning in the plugin sync 403 test On a 403 the service logs two warnings: one from the tag lookup's catch and one from sync(). The test called once() before with(), and Mockery checks the count as soon as once() runs, so it counted both warnings and failed. Putting with() first makes once() apply to the "Could not discover latest release" warning only. Main has failed this test since #553. Co-Authored-By: Claude Opus 5.5 --- tests/Feature/PluginSyncServiceTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Feature/PluginSyncServiceTest.php b/tests/Feature/PluginSyncServiceTest.php index 5c23c5cf..8e43fd50 100644 --- a/tests/Feature/PluginSyncServiceTest.php +++ b/tests/Feature/PluginSyncServiceTest.php @@ -131,11 +131,11 @@ public function test_sync_does_not_read_default_branch_when_release_discovery_fa ]); $this->assertFalse((new PluginSyncService)->sync($plugin)); - Log::shouldHaveReceived('warning')->once()->with( + Log::shouldHaveReceived('warning')->with( '[PluginSync] Could not discover latest release', \Mockery::on(fn (array $context): bool => $context['plugin_id'] === $plugin->id && str_contains($context['error'], '403')), - ); + )->once(); $this->assertSame('Existing documentation', $plugin->fresh()->readme_html); $this->assertNull($plugin->fresh()->last_synced_at); Http::assertNotSent(fn (Request $request): bool => str_contains($request->url(), '/contents/'));