fedi-feed-router/tests/TestCase.php
myrmidex 19cbea9273
All checks were successful
CI / ci (push) Successful in 5m24s
25 - Disable Vite in tests to fix CI manifest errors
2026-03-08 14:58:00 +01:00

46 lines
1.2 KiB
PHP

<?php
namespace Tests;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
use Illuminate\Support\Facades\Facade;
use Illuminate\Support\Facades\Http;
use Mockery;
abstract class TestCase extends BaseTestCase
{
use CreatesApplication;
protected function setUp(): void
{
parent::setUp();
// Prevent Vite manifest errors in tests (no npm build in CI)
$this->withoutVite();
// Clean up any existing Mockery instances before each test
if (class_exists(Mockery::class)) {
Mockery::close();
Mockery::globalHelpers();
}
// Prevent any external HTTP requests during tests unless explicitly faked in a test
Http::preventStrayRequests();
}
protected function tearDown(): void
{
// Clear HTTP fakes between tests to prevent interference
Http::clearResolvedInstances();
// Clear all facade instances to prevent interference
Facade::clearResolvedInstances();
// Ensure Mockery is properly closed to prevent facade interference
if (class_exists(Mockery::class)) {
Mockery::close();
}
parent::tearDown();
}
}