Files
coolify/tests/CreatesApplication.php
Andras Bacsai f2648e4d61 feat(nodes): add metrics controls and harden cluster operations
Add node metrics pages and Sentinel collection controls, sharing chart views with server metrics.

Scope network allocation to teams and clusters, validate ingress names, and prevent deployments to controllers or servers without workload placement.
2026-11-02 12:19:17 +01:00

36 lines
1.0 KiB
PHP

<?php
namespace Tests;
use Illuminate\Contracts\Console\Kernel;
use Illuminate\Foundation\Application;
trait CreatesApplication
{
/**
* Creates the application.
*/
public function createApplication(): Application
{
// Container environment variables must never select the development database.
putenv('DB_CONNECTION=testing');
$_ENV['DB_CONNECTION'] = 'testing';
$_SERVER['DB_CONNECTION'] = 'testing';
$app = require __DIR__.'/../bootstrap/app.php';
if ($app->configurationIsCached()) {
throw new \RuntimeException('Clear the configuration cache before running tests.');
}
$app->make(Kernel::class)->bootstrap();
if ($app->make('config')->get('database.default') !== 'testing'
|| $app->make('config')->get('database.connections.testing.database') !== ':memory:') {
throw new \RuntimeException('Tests require the in-memory testing database. Clear the configuration cache before running tests.');
}
return $app;
}
}