|  | 
| 7 | 7 | use OpenAI\Client; | 
| 8 | 8 | use OpenAI\Contracts\ClientContract; | 
| 9 | 9 | use OpenAI\Symfony\OpenAIBundle; | 
|  | 10 | +use PHPUnit\Framework\Attributes\DoesNotPerformAssertions; | 
| 10 | 11 | use PHPUnit\Framework\TestCase; | 
| 11 | 12 | use Symfony\Bundle\FrameworkBundle\FrameworkBundle; | 
| 12 | 13 | use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; | 
| 13 | 14 | use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; | 
|  | 15 | +use Symfony\Component\ErrorHandler\ErrorHandler; | 
| 14 | 16 | use Symfony\Component\HttpClient\MockHttpClient; | 
| 15 | 17 | use Symfony\Component\HttpClient\Response\MockResponse; | 
| 16 | 18 | use Symfony\Component\HttpKernel\Kernel; | 
|  | 
| 19 | 21 | 
 | 
| 20 | 22 | final class OpenAIBundleTest extends TestCase | 
| 21 | 23 | { | 
|  | 24 | +    public static function setUpBeforeClass(): void | 
|  | 25 | +    { | 
|  | 26 | +        ErrorHandler::register(null, false); | 
|  | 27 | +    } | 
|  | 28 | + | 
|  | 29 | +    #[DoesNotPerformAssertions] | 
|  | 30 | +    public function test_defaults(): void | 
|  | 31 | +    { | 
|  | 32 | +        $kernel = new class('test', true) extends Kernel | 
|  | 33 | +        { | 
|  | 34 | +            use MicroKernelTrait; | 
|  | 35 | + | 
|  | 36 | +            public function registerBundles(): iterable | 
|  | 37 | +            { | 
|  | 38 | +                yield new FrameworkBundle; | 
|  | 39 | +                yield new OpenAIBundle; | 
|  | 40 | +            } | 
|  | 41 | + | 
|  | 42 | +            protected function configureContainer(ContainerConfigurator $container): void | 
|  | 43 | +            { | 
|  | 44 | +                $container->extension('framework', [ | 
|  | 45 | +                    'secret' => 'S0ME_SECRET', | 
|  | 46 | +                    'http_method_override' => false, | 
|  | 47 | +                    'handle_all_throwables' => true, | 
|  | 48 | +                    'php_errors' => ['log' => true], | 
|  | 49 | +                ]); | 
|  | 50 | +            } | 
|  | 51 | +        }; | 
|  | 52 | + | 
|  | 53 | +        $kernel->boot(); | 
|  | 54 | +    } | 
|  | 55 | + | 
| 22 | 56 |     public function test_service(): void | 
| 23 | 57 |     { | 
| 24 | 58 |         $kernel = new class('test', true) extends Kernel | 
|  | 
0 commit comments