mirror of
https://github.com/coollabsio/coolify.git
synced 2026-10-29 01:54:37 +08:00
- Update tests whose expectations no longer matched intended changes (GitHub App redirect, wildcard domains, container IDs, nightly install folders, localhost metadata, Sentinel restart on save) - Seed the instance settings the 2FA profile test needs - Run the global Pest hooks for all test folders and release the Laravel application after each test, so tests do not leak state - Replace a class alias mock that broke later tests - Generate factory names that always pass name validation; Faker names with apostrophes or short words made form tests fail at random
27 lines
713 B
PHP
27 lines
713 B
PHP
<?php
|
|
|
|
namespace Tests;
|
|
|
|
use Illuminate\Container\Container;
|
|
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
|
|
use Illuminate\Support\Facades\Facade;
|
|
|
|
abstract class TestCase extends BaseTestCase
|
|
{
|
|
use CreatesApplication;
|
|
|
|
/**
|
|
* Laravel flushes the application on tear down but leaves it set as the facade
|
|
* application and container instance. Plain unit tests that mock facades or call
|
|
* helpers afterwards would then resolve bindings from that empty application.
|
|
*/
|
|
protected function tearDown(): void
|
|
{
|
|
parent::tearDown();
|
|
|
|
Facade::clearResolvedInstances();
|
|
Facade::setFacadeApplication(null);
|
|
Container::setInstance(null);
|
|
}
|
|
}
|