app = require $root . '/bootstrap/app.php'; } public function test_storage_url_generation(): void { $manager = $this->app->container()->get(StorageManager::class); $this->assertInstanceOf(StorageManager::class, $manager); // Test with public disk url $url = $manager->url('avatars/user.jpg', 'public'); $this->assertStringContainsString('/storage/avatars/user.jpg', $url); } public function test_cache_service_is_bound(): void { $cache = $this->app->container()->get(CacheInterface::class); $this->assertInstanceOf(CacheInterface::class, $cache); $cache->set('radar_test', 'working', 10); $this->assertEquals('working', $cache->get('radar_test')); $cache->delete('radar_test'); } public function test_http_client_profiling(): void { putenv('APP_DEBUG=true'); \Phred\Support\Config::clear(); \Phred\Http\Middleware\Middleware::recordTiming('Warmup', 0.0); $kernel = new Kernel(); $client = $kernel->container()->get(ClientInterface::class); try { $client->sendRequest(new Request('GET', 'http://localhost:1')); } catch (\Throwable) { // expected to fail } $timings = \Phred\Http\Middleware\Middleware::getTimings(); $this->assertArrayHasKey('HTTP: localhost', $timings); } }