php-content/tests/TestCase.php
Claude a332148056
Some checks failed
CI / PHP 8.3 (push) Failing after 1m30s
CI / PHP 8.4 (push) Failing after 1m28s
fix: move config directives before definition finalization and use Mockery for CdnPurgeService stub
- Move URI config calls before maybeGetRawHTMLDefinition() which
  finalizes the config and prevents further set() calls
- Use Mockery::mock()->shouldIgnoreMissing() for CdnPurgeService stub
  to satisfy type hint in ContentItemObserver

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 12:20:12 +00:00

36 lines
1,023 B
PHP

<?php
declare(strict_types=1);
namespace Tests;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Orchestra\Testbench\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
use RefreshDatabase;
protected function getPackageProviders($app): array
{
return [
\Core\Tenant\Boot::class,
\Core\Mod\Content\Boot::class,
];
}
protected function getEnvironmentSetUp($app): void
{
$app['config']->set('database.default', 'testing');
$app['config']->set('database.connections.testing', [
'driver' => 'sqlite',
'database' => ':memory:',
'prefix' => '',
]);
// Stub external dependencies not available in test environment
if (! class_exists(\Plug\Cdn\CdnManager::class)) {
$app->bind(\Core\Mod\Content\Services\CdnPurgeService::class, fn () => \Mockery::mock(\Core\Mod\Content\Services\CdnPurgeService::class)->shouldIgnoreMissing());
}
}
}