<?php

namespace Tests\Feature\Resume;

use App\Services\Resume\OpenAiResumeAnalyzer;
use RuntimeException;
use Tests\TestCase;

class OpenAiResumeAnalyzerTest extends TestCase
{
    public function test_it_fails_safely_when_openai_api_key_is_missing(): void
    {
        config(['services.openai.api_key' => null]);

        $this->expectException(RuntimeException::class);
        $this->expectExceptionMessage('OpenAI API key is not configured.');

        app(OpenAiResumeAnalyzer::class)->analyze('Remote resume text with enough content to reach analyzer configuration.');
    }
}
