HTMLPurifier: set HTML.DefinitionID and HTML.DefinitionRev which are required when using maybeGetRawHTMLDefinition(). CdnManager: bind a stub in tests when Plug\Cdn\CdnManager class is not available (external dependency not in test environment). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
36 lines
925 B
PHP
36 lines
925 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(\Plug\Cdn\CdnManager::class, fn () => new class {});
|
|
}
|
|
}
|
|
}
|