lthn.io/tests/TestCase.php
Claude 0241e1f4a6
feat: TestCase base class + test infrastructure
tests/TestCase.php bootstraps app via Core\Boot::app() with kernel
bootstrap. DatabaseTransactions for test isolation. PHPUnit config
with array cache/session. 12 tests written, unit tests pass.
HTTP endpoint tests need chain daemon mock to run standalone.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 12:17:54 +01:00

21 lines
548 B
PHP

<?php
declare(strict_types=1);
namespace Tests;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
public function createApplication(): \Illuminate\Foundation\Application
{
// Same bootstrap as Core\Init — use App\Boot if exists, else Core\Boot
$bootClass = class_exists('App\\Boot') ? 'App\\Boot' : \Core\Boot::class;
$app = $bootClass::app();
$app->make(\Illuminate\Contracts\Console\Kernel::class)->bootstrap();
return $app;
}
}