fix: bind CdnPurgeService stub instead of CdnManager
The type-hinted constructor on CdnPurgeService requires Plug\Cdn\CdnManager which doesn't exist in test env. Bind the service itself with a no-op stub. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
381a97aa03
commit
f20fd362d4
1 changed files with 6 additions and 1 deletions
|
|
@ -30,7 +30,12 @@ abstract class TestCase extends BaseTestCase
|
|||
|
||||
// Stub external dependencies not available in test environment
|
||||
if (! class_exists(\Plug\Cdn\CdnManager::class)) {
|
||||
$app->bind(\Plug\Cdn\CdnManager::class, fn () => new class {});
|
||||
$app->bind(\Core\Mod\Content\Services\CdnPurgeService::class, fn () => new class {
|
||||
public function isEnabled(): bool { return false; }
|
||||
public function purgeContent($content) { return null; }
|
||||
public function purgeUrls(array $urls) { return null; }
|
||||
public function purgeWorkspace(string $uuid) { return null; }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue