Skip to content

Commit 3f85e74

Browse files
simonhampclaude
andcommitted
Mock SatisService in plugin OG image deletion test
The plugin deleting hook resolves SatisService, whose constructor assigns the (string-typed) api key from config. In CI SATIS_API_KEY is unset, so the null config value triggered a TypeError. Mock the service in the deletion test (matching existing Satis test conventions) since the test only exercises OG image cleanup. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 9c1e758 commit 3f85e74

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎tests/Feature/PluginOgImageTest.php‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use App\Models\Plugin;
77
use App\Services\PluginOgLayout;
88
use App\Services\PluginSyncService;
9+
use App\Services\SatisService;
910
use Illuminate\Foundation\Testing\RefreshDatabase;
1011
use Illuminate\Support\Facades\Http;
1112
use Illuminate\Support\Facades\Queue;
@@ -117,6 +118,11 @@ public function test_deleting_plugin_removes_its_og_image(): void
117118
{
118119
Storage::fake('public');
119120

121+
// The plugin's deleting hook also talks to Satis, which we don't exercise here.
122+
$this->mock(SatisService::class)
123+
->shouldReceive('removePackage')
124+
->andReturn([]);
125+
120126
$plugin = Plugin::factory()->approved()->create([
121127
'og_image' => 'https://nativephp.com.test/storage/og-images/plugins/42.png',
122128
]);

0 commit comments

Comments
 (0)